SemaphoreSecurity.RemoveAuditRule(SemaphoreAuditRule) 方法
定义
搜索以下的审核控制规则:与指定的规则具有相同的用户,并具有兼容的继承和传播标志;如果找到兼容规则,则从中移除指定的规则中包含的权限。Searches for an audit control rule with the same user as the specified rule, and with compatible inheritance and propagation flags; if a compatible rule is found, the rights contained in the specified rule are removed from it.
public:
bool RemoveAuditRule(System::Security::AccessControl::SemaphoreAuditRule ^ rule);
public bool RemoveAuditRule (System.Security.AccessControl.SemaphoreAuditRule rule);
override this.RemoveAuditRule : System.Security.AccessControl.SemaphoreAuditRule -> bool
Public Function RemoveAuditRule (rule As SemaphoreAuditRule) As Boolean
参数
- rule
- SemaphoreAuditRule
一个 SemaphoreAuditRule,指定要搜索的用户以及匹配规则(如果找到)必须兼容的一组继承和传播标志。A SemaphoreAuditRule that specifies the user to search for, and a set of inheritance and propagation flags that a matching rule, if found, must be compatible with. 指定要从兼容规则移除的权限(如果找到)。Specifies the rights to remove from the compatible rule, if found.
返回
如果找到一个兼容规则,则为 true;否则为 false。true if a compatible rule is found; otherwise, false.
例外
rule 为 null。rule is null.
注解
搜索当前的, SemaphoreSecurity 其中包含与相同的用户的审核规则 rule 。The current SemaphoreSecurity is searched for an audit rule that has the same user as rule. 如果未找到此类规则,则不执行任何操作,并且该方法将返回 false 。If no such rule is found, no action is taken, and the method returns false. 如果找到匹配规则,则检查其继承和兼容性标志是否与中指定的标志兼容 rule 。If matching rules are found, their inheritance and compatibility flags are checked for compatibility with the flags specified in rule. 如果未找到兼容的规则,则不执行任何操作,并且该方法将返回 false 。If no compatible rule is found, no action is taken, and the method returns false. 如果找到具有兼容标志的规则,则中指定的权限 rule 将从兼容规则中删除,并且该方法将返回 true 。If a rule with compatible flags is found, the rights specified in rule are removed from the compatible rule, and the method returns true. 如果 rule 指定的权限不包含在兼容规则中,则不会对这些权限采取任何措施。If rule specifies rights not contained in the compatible rule, no action is taken with respect to those rights. 如果从兼容规则中删除所有权限,则将从当前对象中删除整个规则 SemaphoreSecurity 。If all rights are removed from the compatible rule, the entire rule is removed from the current SemaphoreSecurity object.
重要
尽管可以通过使用方法创建信号量审核规则来指定继承和传播标志,但 AuditRuleFactory 不建议这样做。Although you can specify inheritance and propagation flags for semaphore audit rules, by creating them with the AuditRuleFactory method, this is not recommended. 继承和传播对于命名的信号量没有意义,它们使审核规则的维护变得更加复杂。Inheritance and propagation have no meaning for named semaphores, and they make the maintenance of audit rules more complicated.