我使用python添加所有允许或所有deny permisson文件夹:
info=win32security.DACL_SECURITY_INFORMATION
sd=win32security.GetFileSecurity(str(path),info)
acl=sd.GetSecurityDescriptorDacl()
systemName=socket.gethostname()
accountName=getpass.getuser()
sidUser=win32security.LookupAccountName(str(systemName),str(accountName))
acl.AddAccessAllowedAceEx(win32security.ACL_REVISION_DS,
win32security.OBJECT_INHERIT_ACE|win32security.CONTAINER_INHERIT_ACE,
win32file.FILE_ALL_ACCESS, sidUser[0])
#acl.AddAccessDeniedAceEx(win32security.ACL_REVISION_DS,
#win32security.OBJECT_INHERIT_ACE|win32security.CONTAINER_INHERIT_ACE,
#win32file.FILE_ALL_ACCESS, sidUser[0])
sd.SetSecurityDescriptorDacl(1, acl, 0)
win32security.SetFileSecurity(str(path), info, sd)
但是当我检查这个文件夹的权限时。拒绝和允许许可都被检查。有没有办法改变这一点,只允许或拒绝允许检查。感谢