Share via


EventWaitHandleSecurity.AccessRuleFactory 方法

定義

以指定的存取權限、存取控制和旗標,為指定的使用者建立新的存取控制規則。

public:
 override System::Security::AccessControl::AccessRule ^ AccessRuleFactory(System::Security::Principal::IdentityReference ^ identityReference, int accessMask, bool isInherited, System::Security::AccessControl::InheritanceFlags inheritanceFlags, System::Security::AccessControl::PropagationFlags propagationFlags, System::Security::AccessControl::AccessControlType type);
public override System.Security.AccessControl.AccessRule AccessRuleFactory (System.Security.Principal.IdentityReference identityReference, int accessMask, bool isInherited, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags, System.Security.AccessControl.AccessControlType type);
override this.AccessRuleFactory : System.Security.Principal.IdentityReference * int * bool * System.Security.AccessControl.InheritanceFlags * System.Security.AccessControl.PropagationFlags * System.Security.AccessControl.AccessControlType -> System.Security.AccessControl.AccessRule
Public Overrides Function AccessRuleFactory (identityReference As IdentityReference, accessMask As Integer, isInherited As Boolean, inheritanceFlags As InheritanceFlags, propagationFlags As PropagationFlags, type As AccessControlType) As AccessRule

參數

identityReference
IdentityReference

IdentityReference,可識別套用這個規則的使用者或群組。

accessMask
Int32

EventWaitHandleRights 值的位元組合,指定允許或拒絕的存取權限 (轉型成整數)。

isInherited
Boolean

命名為等候控制代碼是沒有意義的,因為它們並未具有階層架構。

inheritanceFlags
InheritanceFlags

命名為等候控制代碼是沒有意義的,因為它們並未具有階層架構。

propagationFlags
PropagationFlags

命名為等候控制代碼是沒有意義的,因為它們並未具有階層架構。

type
AccessControlType

其中一個 AccessControlType 值,指定允許還是拒絕權限。

傳回

EventWaitHandleAccessRule 物件,表示指定之使用者的指定權限。

例外狀況

accessMaskinheritanceFlagspropagationFlagstype 會指定無效的值。

identityReferencenull

-或-

accessMask 為零。

identityReference 既不是 SecurityIdentifier 型別,也不是可以轉換成 NTAccount 型別的型別 (例如 SecurityIdentifier)。

備註

建立訪問控制規則的建議方法是使用 類別的 EventWaitHandleAccessRule 建構函式。

注意

雖然繼承和傳播旗標對具名事件而言沒有意義,但仍可以指定它們。 不建議這麼做,因為它不需要使規則的維護複雜,例如干擾其他相容規則的組合。

適用於