アプリケーションに4つのフォルダーがあり、それぞれに特定の権限があります...
folder1 にはその中に folder2 があり、folder2 にはその中に folder3 と folder4 があります
以下のコードでフォルダー2からフォルダー3への継承を拒否できますが、フォルダー1からフォルダー3への継承が必要ですか?
フォルダーが folder1 からすべてのプロパティを継承するようにしたい
string folderpath="xyz";
string UserAccount = "asp";
System.IO.DirectoryInfo FolderInfo = new System.IO.DirectoryInfo(folderpath);
DirectorySecurity FolderAcl = new DirectorySecurity();
FolderAcl.AddAccessRule(new FileSystemAccessRule(UserAccount, FileSystemRights.ReadData, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow));
const bool protectRulesFromInheritance = true;
const bool preserveInheritance = true;
FolderAcl.SetAccessRuleProtection(protectRulesFromInheritance, preserveInheritance);
FolderInfo.SetAccessControl(FolderAcl);