MutexSecurity::ResetAccessRule Method (MutexAccessRule^)
Removes all access control rules with the same user as the specified rule, regardless of AccessControlType, and then adds the specified rule.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- rule
-
Type:
System.Security.AccessControl::MutexAccessRule^
The MutexAccessRule to add. The user specified by this rule determines the rules to remove before this rule is added.
| Exception | Condition |
|---|---|
| ArgumentNullException | rule is null. |
If there are no access rules whose user matches the specified rule, rule is added.
The following code example shows how the ResetAccessRule method replaces all rules for the matching user with the rule specified for the match.
The example creates a MutexSecurity object and adds rules that allow and deny various rights for the current user. The example then creates a new rule that allows the current user full control, and uses the ResetAccessRule method to replace both of the existing rules with the new rule.
Note |
|---|
This example does not attach the security object to a Mutex object. Examples that attach security objects can be found in Mutex::GetAccessControl and Mutex::SetAccessControl. |
Available since 2.0
