public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified) { if (rule == null) { throw new ArgumentNullException("rule"); } if (!this.AuditRuleType.IsAssignableFrom(rule.GetType())) { throw new ArgumentException( Environment.GetResourceString("AccessControl_InvalidAuditRuleType"), "rule"); } Contract.EndContractBlock(); WriteLock(); try { return(ModifyAudit(modification, rule, out modified)); } finally { WriteUnlock(); } }
public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified) { if (rule == null) { throw new ArgumentNullException(nameof(rule)); } if (!this.AuditRuleType.GetTypeInfo().IsAssignableFrom(rule.GetType().GetTypeInfo())) { throw new ArgumentException( SR.AccessControl_InvalidAuditRuleType, nameof(rule)); } WriteLock(); try { return(ModifyAudit(modification, rule, out modified)); } finally { WriteUnlock(); } }
/// <summary>将指定修改应用于与此 <see cref="T:System.Security.AccessControl.DirectoryObjectSecurity" /> 对象关联的系统访问控制列表 (SACL)。</summary> /// <returns>如果成功修改了 SACL,则为 true;否则为 false。</returns> /// <param name="modification">要应用于 SACL 的修改。</param> /// <param name="rule">要修改的审核规则。</param> /// <param name="modified">如果成功修改了 SACL,则为 true;否则为 false。</param> protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified) { if (!this.AuditRuleType.IsAssignableFrom(rule.GetType())) { throw new ArgumentException(Environment.GetResourceString("AccessControl_InvalidAuditRuleType"), "rule"); } return(this.ModifyAudit(modification, rule as ObjectAuditRule, out modified)); }
public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified) { if (rule == null) { throw new ArgumentNullException("rule"); } if (!AuditRuleType.IsAssignableFrom(rule.GetType())) { throw new ArgumentException("rule"); } return(ModifyAudit(modification, rule, out modified)); }
public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified) { if ( rule == null ) { throw new ArgumentNullException( nameof(rule)); } if ( !this.AuditRuleType.GetTypeInfo().IsAssignableFrom(rule.GetType().GetTypeInfo()) ) { throw new ArgumentException( SR.AccessControl_InvalidAuditRuleType, nameof(rule)); } Contract.EndContractBlock(); WriteLock(); try { return ModifyAudit(modification, rule, out modified); } finally { WriteUnlock(); } }
public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified) { if ( rule == null ) { throw new ArgumentNullException( "rule" ); } if ( !this.AuditRuleType.IsAssignableFrom(rule.GetType()) ) { throw new ArgumentException( Environment.GetResourceString("AccessControl_InvalidAuditRuleType"), "rule"); } Contract.EndContractBlock(); WriteLock(); try { return ModifyAudit(modification, rule, out modified); } finally { WriteUnlock(); } }
protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified) { if ( !this.AuditRuleType.IsAssignableFrom(rule.GetType()) ) { throw new ArgumentException( Environment.GetResourceString("AccessControl_InvalidAuditRuleType"), "rule"); } Contract.EndContractBlock(); return ModifyAudit(modification, rule as ObjectAuditRule, out modified); }
public virtual bool ModifyAuditRule (AccessControlModification modification, AuditRule rule, out bool modified) { if (rule == null) throw new ArgumentNullException ("rule"); if (!AuditRuleType.IsAssignableFrom (rule.GetType())) throw new ArgumentException ("rule"); return ModifyAudit (modification, rule, out modified); }