[MacRuby-devel] Admin privileges / Authorization Framework

Jeff Dyck fsjjeff at gmail.com
Mon Apr 8 11:08:53 PDT 2013


Hey all, I'm desperately hoping for some help here...

I'm a System Admin for a School District with thousands of Macs.  In the past I developed an AppleScript Studio application that our technicians used to backup and restore user accounts when we do system migrations and image updates (basically rsync with some internal logic to filter out files that might conflict).

Anyway, with AppleScript Studio long deprecated, we're starting to see some issues with it running on 10.8, so I've started working on a replacement in MacRuby (which I've started to move to for other development)... I love Ruby vs the pain of AppleScript, especially for things like dealing with xml and whatnot, but I'm running into one HUGE challenge...

My app requires admin privileges to backup and restore user accounts and restore permissions.  In AppleScript Studio this was relatively simple to do using the "do shell script with admin privs' command.  In MacRuby.... I'm stumped.

I've dug in a bit into the Authorization framework, and looked at some of Apple's documentation for splitting your app into helper tools... but it's difficult enough to follow the Obj-C stuff, migrating that to Ruby is probably over my head.

So long story short, anyone have some samples of how to do this with MacRuby?  I'd need to be able to do things like:
	• Calculate size of folders and count of files in another user account (and get result back)
	• Send an RSYNC command as admin (and get feedback for calculating progress)

Here's hoping someone can point me in the right direction. Thanks in advance.

Jeff


More information about the MacRuby-devel mailing list