Just use parental controls on systems that non administrator users log in to.
See the help menu.

Sent from my iPhone

On Jan 24, 2010, at 10:23 PM, cocoa-dev-requ...@lists.apple.com wrote:


I want to allow my cocoa app to be only launched by root/admin users.
How can i achieve this?

As I think has already been mentioned, the UNIX approach is to set the application's owner as root and then make it only executable by the owner. However, Apple largely discourages programmers from developing Cocoa apps that will be run with root privileges.

A better approach, if possible, is to factor out the section of code that needs to be run with root privilege (e.g., to read a protected file or open a network tap) and place that in a command line helper tool. The Cocoa app then runs with normal privileges. When the program needs to perform the privileged operation it calls that helper app (think of it as a kind of remote procedure call).

Look up Apple's BetterAuthorizationSample code for how to do this.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to