CommonObjectSecurity.SetAccessRule(AccessRule) 方法

定义

从与此 CommonObjectSecurity 对象关联的自由访问控制列表 (DACL) 中移除与指定的访问规则具有相同安全性标识符和限定符的所有访问规则,然后添加指定的访问规则。Removes all access rules that contain the same security identifier and qualifier as the specified access rule in the Discretionary Access Control List (DACL) associated with this CommonObjectSecurity object and then adds the specified access rule.

protected:
 void SetAccessRule(System::Security::AccessControl::AccessRule ^ rule);
protected void SetAccessRule (System.Security.AccessControl.AccessRule rule);
member this.SetAccessRule : System.Security.AccessControl.AccessRule -> unit
Protected Sub SetAccessRule (rule As AccessRule)

参数

rule
AccessRule

要设置的访问规则。The access rule to set.

注解

为了避免意外允许访问主体,应用程序应检查是否存在允许每个人完全访问权限(AEFA)访问控制项(ACE),并在修改 DACL 之前将其删除。To avoid unintentionally allowing access to principals, applications should check for the existence of an allow everyone full access (AEFA) access control entry (ACE) and remove it before modifying a DACL.

适用于