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=true``preserveInheritance=true时,需要走对象的新 ACL 并检查 DENY 类型 ACE。 对于按音调排序的 DACL,DENY ACE 必须出现在 DACL 的前面。 有关 ACL 规范排序的详细信息,请参阅 DACL 中的 ACE 顺序

适用于