PDA

View Full Version : Determine User type




ruhi
Oct 23, 2009, 02:21 AM
Hello,

How can i determine the current user type i.e. admin, standard user through my cocoa application?

Thanks,
Ruhi.



chown33
Oct 23, 2009, 12:51 PM
Call the BSD function getgroups() and look for the presence of the admin group (80).

This may not be useful, though. The human using the computer could have a user account that's not in the admin group, but that human still knows an admin-user's name and password.

lee1210
Oct 23, 2009, 01:20 PM
Why don't you design your application with Authorization Services instead?
http://developer.apple.com/mac/library/documentation/Security/Conceptual/authorization_concepts/01introduction/introduction.html

User's will get a consistent experience, understand what's going on when you need to elevate privileges for a certain operation, etc.

-Lee