0

アプリケーションに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);
4

1 に答える 1

0

親からしか継承できません。祖父母からの継承は暗黙的にのみ行われます。つまり、あなたがあなたの親から継承し、あなたの親がその親から継承する場合、暗黙的な祖父母の継承があります。

これ可能であれば、特にフォルダの移動に関しては、管理 (内部的にもユーザー インターフェイスの面でも) は恐ろしいものになるでしょう...

于 2012-07-19T10:52:27.657 に答える