Given a file, I need to list all the users that have read access to that file using C# and .NET framework 4. Not interested in adding or listing any other permissions.
Assume the directory is a local directory and local users are enough.
Given a file, I need to list all the users that have read access
Share
I’m not sure if there’s an easy way to get that list, but here’s an idea. You can loop through the access control rules and check which users can read the file. Beware that some rules allow access while others deny it. Here’s a starting point:
Check FileSystemAccessRule for further information.