简体   繁体   中英

c# - How to determine if a certain user has (effective) read-rights on a file or folder?

I would like to know if a user (known by its name in the active directory) has effective read rights (sharerights and nfts rights) on a certain file or folder.

I do not have not the credentials of the user only its name.

Please have a look at the GetEffectiveRightsFromAcl which is present in the advapi32.dll.

You can try out the code provided here

I would look into the System.Security.AccessControl; namespace as well, it might provide what you are looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM