ObjectSecurity.SetAccessRuleProtection(Boolean, Boolean) 方法

定義

設定或移除與此 ObjectSecurity 物件相關的存取規則保護。 受保護的存取規則不能透過繼承被父物件修改。

public:
 void SetAccessRuleProtection(bool isProtected, bool preserveInheritance);
public void SetAccessRuleProtection(bool isProtected, bool preserveInheritance);
member this.SetAccessRuleProtection : bool * bool -> unit
Public Sub SetAccessRuleProtection (isProtected As Boolean, preserveInheritance As Boolean)

參數

isProtected
Boolean

true 保護與此 ObjectSecurity 物件相關的存取規則免於繼承; false 允許繼承。

preserveInheritance
Boolean

true 以保留繼承的存取規則; false 移除繼承的存取規則。 若 isProtected 為 , false則忽略此參數。

例外狀況

此方法嘗試從非典型的 Discretionary 存取控制 List(DACL)中移除繼承的規則。

備註

當你呼叫帶有 isProtected=truepreserveInheritance=true的方法時,你需要走過物件的新 ACL 並檢查是否有 DENY 類型的 ACE。 對於一個標準排序的 DACL,DENY ACE 必須出現在 DACL 的最前方。 欲了解更多關於 ACL 的典範排序,請參閱 DACL 中 ACE 的順序

適用於