System.Security.AccessControl.MutexSecurity.SetAccessRule Method

Removes all access control rules with the same user and System.Security.AccessControl.AccessControlType (allow or deny) as the specified rule, and then adds the specified rule.

Syntax

public void SetAccessRule (MutexAccessRule rule)

Parameters

rule
The System.Security.AccessControl.MutexAccessRule to add. The user and System.Security.AccessControl.AccessControlType of this rule determine the rules to remove before this rule is added.

Remarks

If the specified rule has AccessControlType.Allow, the effect of this method is to remove all AccessControlType.Allow rules for the specified user, replacing them with the specified rule. If the specified rule has AccessControlType.Deny, all AccessControlType.Deny rules for the specified user are replaced with the specified rule.

If there are no rules whose user and System.Security.AccessControl.AccessControlType match the specified rule, rule is added.

Requirements

Namespace: System.Security.AccessControl
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0