Is there any cross-platform way to check that my Python script is executed with admin rights? Unfortunately, os.getuid()
is UNIX-only and is not available under Win
Administrator group membership (Domain/Local/Enterprise) is one thing..
tailoring your application to not use blanket privilege and setting fine grained rights is a better option especially if the app is being used iinteractively.
testing for particular named privileges (se_shutdown se_restore etc), file rights is abetter bet and easier to diagnose.