usery, domain, type = win32security.LookupAccountName('', 'User Y')
sd = win32security.GetFileSecurity(FILENAME, win32security.
    DACL_SECURITY_INFORMATION)
dacl = sd.GetSecurityDescriptorDacl()
dacl.AddAccessAllowedAce(win32security.ACL_REVISION, con.FILE_GENERIC_READ |
    con.FILE_GENERIC_WRITE, userx)
dacl.AddAccessAllowedAce(win32security.ACL_REVISION, con.FILE_ALL_ACCESS, usery
    )
sd.SetSecurityDescriptorDacl(1, dacl, 0)
win32security.SetFileSecurity(FILENAME, win32security.
    DACL_SECURITY_INFORMATION, sd)
Установка разрешений для папки в Windows с помощью Python