SemaphoreSecurity.AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) 方法

定义

新建审核规则,指定规则应用到的用户、要审核的访问权限以及触发审核规则的结果。Creates a new audit rule, specifying the user the rule applies to, the access rights to audit, and the outcome that triggers the audit rule.

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

参数

identityReference
IdentityReference

一个 IdentityReference,用于标识此规则应用到的用户或组。An IdentityReference that identifies the user or group the rule applies to.

accessMask
Int32

SemaphoreRights 值的按位组合,用于指定要审核的访问权限,该组合将被强制转换为整数。A bitwise combination of SemaphoreRights values specifying the access rights to audit, cast to an integer.

isInherited
Boolean

这对于命名的等待句柄没有意义,因为这些句柄没有层次结构。Meaningless for named wait handles, because they have no hierarchy.

inheritanceFlags
InheritanceFlags

这对于命名的等待句柄没有意义,因为这些句柄没有层次结构。Meaningless for named wait handles, because they have no hierarchy.

propagationFlags
PropagationFlags

这对于命名的等待句柄没有意义,因为这些句柄没有层次结构。Meaningless for named wait handles, because they have no hierarchy.

flags
AuditFlags

AuditFlags 值的按位组合,它指定审核成功的访问、失败的访问还是对这两种情况都进行审核。A bitwise combination of AuditFlags values that specify whether to audit successful access, failed access, or both.

返回

AuditRule

一个 SemaphoreAuditRule 对象,表示指定用户的指定审核规则。A SemaphoreAuditRule object representing the specified audit rule for the specified user. 该方法的返回类型是基类 AuditRule,但可以安全地将返回值强制转换为派生类。The return type of the method is the base class, AuditRule, but the return value can be cast safely to the derived class.

例外

accessMaskinheritanceFlagspropagationFlagsflags 指定了一个无效值。accessMask, inheritanceFlags, propagationFlags, or flags specifies an invalid value.

identityReferencenullidentityReference is null.

- 或 --or- accessMask 为零。accessMask is zero.

identityReference 既不属于类型 SecurityIdentifier,也不属于可以转换为 NTAccount 类型的类型(如 SecurityIdentifier)。identityReference is neither of type SecurityIdentifier, nor of a type such as NTAccount that can be converted to type SecurityIdentifier.

注解

创建审核规则的建议方法是使用类的构造函数 SemaphoreAuditRuleThe recommended way to create audit rules is to use the constructors of the SemaphoreAuditRule class.

备注

虽然继承和传播标志对于命名的信号量没有意义,但仍可以指定它们。Although inheritance and propagation flags are meaningless for named semaphores, it is still possible to specify them. 不建议这样做,因为这样做不会对规则的维护产生一定的影响,例如,妨碍与其他兼容的规则组合。This is not recommended, because it needlessly complicates the maintenance of rules, for example by interfering with the combination of rules that would otherwise be compatible.

适用于