ObjectSecurity.SetAccessRuleProtection(Boolean, Boolean) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定或移除與 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
,就會忽略這個參數。
例外狀況
這個方法會嘗試從非標準判別存取控制清單 (DACL) 中移除繼承的規則。
備註
當您使用 isProtected=true
和 preserveInheritance=true
呼叫 方法時,您必須逐步執行 物件的新 ACL,並檢查 DENY 類型 ACE。
若為以音鍵方式排序的 DACL,DENY ACE 必須出現在 DACL 的前面。
如需 ACL 標準順序的詳細資訊,請參閱 DACL 中的 ACE 順序。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應