System.Security.AccessControl.FileSystemSecurity.RemoveAccessRuleAll Method

Removes all access control list (ACL) permissions for the specified user from the current file or directory.

Syntax

public void RemoveAccessRuleAll (FileSystemAccessRule rule)

Parameters

rule
A System.Security.AccessControl.FileSystemAccessRule object that specifies a user whose access control list (ACL) permissions should be removed from a file or directory.

Remarks

The FileSystemSecurity.RemoveAccessRuleAll(FileSystemAccessRule) method removes all access control list (ACL) permissions for the specified user. The method ignores all values in the System.Security.AccessControl.FileSystemAccessRule object except the user account.

To persist new or changed ACL information to a file, use the System.IO.File.SetAccessControl(string, FileSecurity) or System.IO.FileInfo.SetAccessControl(FileSecurity) method. To persist new or changed ACL information to a directory, use the System.IO.Directory.SetAccessControl(string, DirectorySecurity) or System.IO.FileInfo.SetAccessControl(FileSecurity) method.

To retrieve ACL information from a file, use the erload:System.IO.File.GetAccessControl or erload:System.IO.FileInfo.GetAccessControl method. To retrieve ACL information from a directory, use the erload:System.IO.Directory.GetAccessControl or erload:System.IO.DirectoryInfo.GetAccessControl method.

When you add an access rule without setting the FileSystemRights.Synchronize flag, the FileSystemRights.Synchronize flag will be automatically added to your rule. If you remove the rule later without specifying the FileSystemRights.Synchronize flag, the flag will automatically be removed.

Requirements

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