System.Security.AccessControl.RegistrySecurity.RemoveAccessRuleAll Method

Searches for all access control rules with the same user and System.Security.AccessControl.AccessControlType (allow or deny) as the specified rule and, if found, removes them.

Syntax

public void RemoveAccessRuleAll (RegistryAccessRule rule)

Parameters

rule
A System.Security.AccessControl.RegistryAccessRule that specifies the user and System.Security.AccessControl.AccessControlType to search for. Any rights, inheritance flags, or propagation flags specified by this rule are ignored.

Remarks

The current System.Security.AccessControl.RegistrySecurity is searched for rules that have the same user and the same System.Security.AccessControl.AccessControlType value as rule. Any rights, inheritance flags, or propagation flags specified by rule are ignored when performing this search. If no matching rules are found, no action is taken.

For example, if a user has multiple rules that allow various rights with different inheritance and propagation flags, you can remove all those rules by creating a System.Security.AccessControl.RegistryAccessRule object that specifies the user and AccessControlType.Allow, with any arbitrary rights and flags, and passing that rule to the RegistrySecurity.RemoveAccessRuleAll(RegistryAccessRule) method.

Requirements

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