Re: [MacRuby-devel] Admin privileges / Authorization Framework

2013-04-08 Thread Mario Steele
Hey Jeff, While this is probably not the MacRuby way, this is the Linux Ruby way, and should translate over well to Mac OS X. To have your script run as Root, you simply do the following: if Process::UID.euid != 0 || Process::UID.rid != 0 # Prompt for Password here with a Custom GUI `sudo

Re: [MacRuby-devel] Admin privileges / Authorization Framework

2013-04-08 Thread Steen Klingberg
Jeff, to run commands with admin rights without password, you can do it the unix way. Run sudo visudo and add something like this: steen ALL=(ALL) NOPASSWD: /usr/bin/du then from ruby you can run the command without needing a password: steen$ macirb irb(main):001:0 spawn 'sudo du -s -m