The following code successfully prompts for admin access and outputs "root" when it is run from a non-sandboxed NSApplication that is run by a regular user: