FileSystemSecurity.AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) 方法
定义
初始化 FileSystemAuditRule 类的新实例,它表示指定用户的指定审核规则。Initializes a new instance of the FileSystemAuditRule class representing the specified audit rule for the specified user.
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 sealed 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 NotOverridable 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 object that represents a user account.
- accessMask
- Int32
指定访问类型的整数。An integer that specifies an access type.
- isInherited
- Boolean
如果该访问规则是继承的,则为 true;否则为 false。true if the access rule is inherited; otherwise, false.
- inheritanceFlags
- InheritanceFlags
InheritanceFlags 值之一,指定如何将访问掩码传播到子对象。One of the InheritanceFlags values that specifies how to propagate access masks to child objects.
- propagationFlags
- PropagationFlags
PropagationFlags 值之一,指定如何将访问控制项 (ACE) 传播到子对象。One of the PropagationFlags values that specifies how to propagate Access Control Entries (ACEs) to child objects.
- flags
- AuditFlags
AuditFlags 值之一,指定要执行的审核的类型。One of the AuditFlags values that specifies the type of auditing to perform.
返回
新的 FileSystemAuditRule 对象,表示指定用户的指定审核规则。A new FileSystemAuditRule object representing the specified audit rule for the specified user.
例外
accessMask、inheritanceFlags、propagationFlags 或 flags 属性指定了无效值。The accessMask, inheritanceFlags, propagationFlags, or flags properties specify an invalid value.
identityReference 属性为 null。The identityReference property is null.
- 或 --or-
accessMask 属性为零。The accessMask property is zero.
identityReference 属性既不是 SecurityIdentifier 类型,也不是可转换为 NTAccount 类型的类型,如 SecurityIdentifier。The identityReference property is neither of type SecurityIdentifier, nor of a type such as NTAccount that can be converted to type SecurityIdentifier.
注解
创建审核规则的建议方法是使用类的构造函数 FileSystemAuditRule 。The recommended way to create audit rules is to use the constructors of the FileSystemAuditRule class.
方法的返回类型 AuditRuleFactory 是基类, AuditRule 但返回值可以安全地强制转换为派生类。The return type of the AuditRuleFactory method is the base class, AuditRule, but the return value can be cast safely to the derived class.