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 顺序

适用于