CommonObjectSecurity.AddAccessRule(AccessRule) 方法

定義

將指定的存取規則加入與這個 CommonObjectSecurity 物件相關聯的 Discretionary 存取控制清單 (DACL)。Adds the specified access rule to the Discretionary Access Control List (DACL) associated with this CommonObjectSecurity object.

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

參數

rule
AccessRule

要加入的存取規則。The access rule to add.

備註

新增存取規則可能會導致無法合併 DACL 中的現有存取規則。Adding an access rule might cause existing access rules in the DACL to be merged.

為避免不小心允許存取主體,應用程式應該檢查是否有允許每個人完整存取(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.

適用於