Why do the following access rule show up as “Special permission” when I browse permissions in the explorer property window? I want it to appear as a normal “modify” access.
var di = new DirectoryInfo(ConfigDirectory);
DirectorySecurity security = di.GetAccessControl();
var rule = new FileSystemAccessRule(domainSid, FileSystemRights.Modify, AccessControlType.Allow);
security.AddAccessRule(rule);
di.SetAccessControl(security);
domainSid = SID for domain users.
- How do I create the rule so it’s inherited by all files that are created in that folder?
Use this instead:
The difference is using a
FileSystemAccessRuleConstructor that allows you to specifiy inheritance and the call tosecurity.SetAccessRule(rule);