MartinHappyCoding
MartinHappyCoding

Reputation: 321

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.

Upvotes: 3

Views: 241

Answers (2)

Bearcat9425
Bearcat9425

Reputation: 1600

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

Upvotes: 0

Patrick D'Souza
Patrick D'Souza

Reputation: 3573

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

You can try out the code provided here

Upvotes: 2

Related Questions