[python-win32] Reg. taking folder ownership

Tim Roberts timr at probo.com
Mon Aug 27 11:40:25 EDT 2018


Goku Balu wrote:
>
> My use case is this. Folder1 is created by Admin1 and ACL is set by 
> Admin1. Now Admin2 wants to change the ACL. I think we have two 
> options here
> 1) Take folder ownership and the do the changes
> 2) Take elevated privileges for Admin2 account and add/remove ACL 
> entries (Similar to "Run as Administrator" and using icalcs in cmd)
>
> I'm trying to solve this with the first approach. After Googling 
> around, here is the code I'm trying to run for taking ownership from 
> Admin1 and assign it to Admin2.

The Windows file permission ecosystem makes my head hurt, so I'm going 
to avoid answering your exact question, but I would point out that 
Admin1 can change the ACL to give Admin2 the right to change the ACL.  
In the file permission dialog, that's the "Change permissions" right.  
In code, it's the "WRITE_DAC" file permission.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3980 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-win32/attachments/20180827/1d1cbb85/attachment.bin>


More information about the python-win32 mailing list