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 表示移除繼承的存取規則。 如果 isProtectedfalse,就會忽略這個參數。

例外狀況

這個方法會嘗試從非標準判別存取控制清單 (DACL) 中移除繼承的規則。

備註

當您使用 isProtected=truepreserveInheritance=true 呼叫 方法時,您必須逐步執行 物件的新 ACL,並檢查 DENY 類型 ACE。 若為以音鍵方式排序的 DACL,DENY ACE 必須出現在 DACL 的前面。 如需 ACL 標準順序的詳細資訊,請參閱 DACL 中的 ACE 順序

適用於