Link to home
Start Free TrialLog in
Avatar of schubduese
schubdueseFlag for Switzerland

asked on

C# FilesystemRights using System.Security.AccessControl

I wrote a program which retrieves all rights for a specific folder / file using System.Security.AccessControl. For all possible file I get the following information:

- AccessControlType
- FileSystemRights
- Trustee
- IsInherited
- Inheritanceflags
- Propagationflags

Here's a possible Output:
      <ace>
        <trustee>Power Users</trustee>
        <access>Allow</access>
        <rights>ReadAndExecute, Synchronize</rights>
        <inherited>True</inherited>
        <inheritanceflags>None</inheritanceflags>
        <propagationflags>None</propagationflags>
      </ace>
      <ace>
        <trustee>Power Users</trustee>
        <access>Allow</access>
        <rights>-1610612736</rights>
        <inherited>True</inherited>
        <inheritanceflags>ContainerInherit, ObjectInherit</inheritanceflags>
        <propagationflags>InheritOnly</propagationflags>
      </ace>
      <ace>
        <trustee>Power Users</trustee>
        <access>Allow</access>
        <rights>Modify, Synchronize</rights>
        <inherited>True</inherited>
        <inheritanceflags>None</inheritanceflags>
        <propagationflags>None</propagationflags>
      </ace>
      <ace>
        <trustee>Power Users</trustee>
        <access>Allow</access>
        <rights>-536805376</rights>
        <inherited>True</inherited>
        <inheritanceflags>ContainerInherit</inheritanceflags>
        <propagationflags>InheritOnly</propagationflags>
      </ace>

Can anyone explain why the rights are sometimes numbers and sometimes words. And how do I convert either the number to words or the words to numbers?
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

I would think that you are using enumerations, and not designating those enumerations to be flags (or not including the right enumeration values), but that is just a wild guess...
ASKER CERTIFIED SOLUTION
Avatar of schubduese
schubduese
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial