I want to give anyone full access to a specific folder (+sub-folders +files in it). I tried that code:
f = "c:\test" #... which is the folder
#vars
sidWorld = win32security.CreateWellKnownSid(win32security.WinWorldSid, None)
worldRights = win32file.FILE_ALL_ACCESS
#get DACL
fileSecDesc = win32security.GetNamedSecurityInfo( \
f, win32security.SE_FILE_OBJECT, win32security.DACL_SECURITY_INFORMATION)
fileDacl = fileSecDesc.GetSecurityDescriptorDacl()
#add rights
fileDacl.AddAccessAllowedAce( win32security.ACL_REVISION, worldRights, sidWorld )
win32security.SetNamedSecurityInfo( \
f, win32security.SE_FILE_OBJECT, win32security.DACL_SECURITY_INFORMATION, \
None, None, fileDacl, None )
Problem is, it isn't shown as full access, i think because of the missing inheritance (I also need inheritance). I cannot figure out how to solve this.
Any idea what I'm missing? Thanks, best regards, Florian Lagg.