FileSystemSecurity.RemoveAccessRuleSpecific(FileSystemAccessRule) 方法
定义
从当前文件或目录移除单个匹配的允许或拒绝访问控制列表 (ACL) 权限。Removes a single matching allow or deny access control list (ACL) permission from the current file or directory.
public:
void RemoveAccessRuleSpecific(System::Security::AccessControl::FileSystemAccessRule ^ rule);
public void RemoveAccessRuleSpecific (System.Security.AccessControl.FileSystemAccessRule rule);
override this.RemoveAccessRuleSpecific : System.Security.AccessControl.FileSystemAccessRule -> unit
Public Sub RemoveAccessRuleSpecific (rule As FileSystemAccessRule)
参数
- rule
- FileSystemAccessRule
一个 FileSystemAccessRule 对象,该对象指定应该从文件或目录移除其访问控制列表 (ACL) 权限的用户。A FileSystemAccessRule object that specifies a user whose access control list (ACL) permissions should be removed from a file or directory.
例外
rule 参数为 null。The rule parameter is null.
注解
RemoveAccessRuleSpecific方法 Deny 从当前对象中移除指定的访问规则或指定的匹配 Allow 访问规则 FileSystemSecurity 。The RemoveAccessRuleSpecific method removes the specified Deny access rule or the specified matching Allow access rule from the current FileSystemSecurity object. 例如,你可以使用此方法 Deny 通过传递 FileSystemAccessRule 使用 Deny 值、 Read 值和用户帐户创建的对象,为用户删除指定的访问规则。For example, you can use this method to remove a specified Deny access rule for a user by passing a FileSystemAccessRule object created using the Deny value, the Read value, and a user account. 执行此操作时, RemoveAccessRuleSpecific 方法只删除指定值的拒绝规则 Read 。When you do this, the RemoveAccessRuleSpecific method removes only the deny rule that specifies the Read value. 它不会删除任何指定值的拒绝规则 Write 。It does not remove any deny rules that specify the Write value.
若要将新的或更改的访问控制列表 (ACL) 信息保存到文件中,请使用 SetAccessControl 或 SetAccessControl 方法。To persist new or changed access control list (ACL) information to a file, use the SetAccessControl or SetAccessControl method. 若要将新的或更改的 ACL 信息保存到目录中,请使用 SetAccessControl 或 SetAccessControl 方法。To persist new or changed ACL information to a directory, use the SetAccessControl or SetAccessControl method.
若要从文件中检索 ACL 信息,请使用 GetAccessControl 或 GetAccessControl 方法。To retrieve ACL information from a file, use the GetAccessControl or GetAccessControl method. 若要从目录中检索 ACL 信息,请使用 GetAccessControl 或 GetAccessControl 方法。To retrieve ACL information from a directory, use the GetAccessControl or GetAccessControl method.
当你在未设置标志的情况下添加访问规则时 Synchronize , Synchronize 标志将自动添加到你的规则。When you add an access rule without setting the Synchronize flag, the Synchronize flag will be automatically added to your rule. 如果以后在不指定标志的情况下删除该规则 Synchronize ,将自动删除该标志。If you remove the rule later without specifying the Synchronize flag, the flag will automatically be removed.