1

我有一些代码可以将权限应用于有效的文件夹,但它将文件夹权限设置为“特殊”,并将其应用为“此文件夹和文件”,我需要将其应用为“此文件夹、子文件夹和文件”。我究竟做错了什么?

dSecurity.AddAccessRule(new FileSystemAccessRule(@"DOMAIN\" + Account, FileSystemRights.ReadAndExecute, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, ControlType));
4

1 回答 1

2

尝试将其拆分为两条规则;

dSecurity.AddAccessRule(new FileSystemAccessRule(@"DOMAIN\" + Account, FileSystemRights.ReadAndExecute, InheritanceFlags.ContainerInherit, PropagationFlags.InheritOnly, ControlType));
dSecurity.AddAccessRule(new FileSystemAccessRule(@"DOMAIN\" + Account, FileSystemRights.ReadAndExecute, InheritanceFlags.ObjectInherit, PropagationFlags.InheritOnly, ControlType));
于 2017-03-15T16:18:27.423 回答