文件夹权限
为什么当我在资源管理器属性窗口中浏览权限时,以下访问规则显示为“特殊权限”?我希望它显示为正常的“修改”访问。
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。
- 如何创建规则,以便该文件夹中创建的所有文件都继承该规则?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请改用它:
区别在于使用
FileSystemAccessRule
构造函数,该构造函数允许您指定继承和对security.SetAccessRule(rule);
的调用Use this instead:
The difference is using a
FileSystemAccessRule
Constructor that allows you to specifiy inheritance and the call tosecurity.SetAccessRule(rule);