Re: How to find the logged in user is Admin or Standard user?
Re: How to find the logged in user is Admin or Standard user?
- Subject: Re: How to find the logged in user is Admin or Standard user?
- From: Quinn <email@hidden>
- Date: Fri, 4 Jan 2008 16:43:06 +0000
At 21:23 +0530 4/1/08, sunil prajapati wrote:
How to find programmatically whether logged in user is Admin or Standard ?
The definition of an admin user is that they are in group "admin"
(80). You can test group membership using
<x-man-page://3/mbr_check_membership>. Use mbr_uid_to_uuid and
mbr_gid_to_uuid to convert the UID and GID to uuid_t's.
Keep in mind that making security decisions like this is generally a
mistake. It's fine to use this sort of info for user feedback (for
example, the Finder puts a crossed out pencil icon in windows that it
thinks are unwriteable). However, you should leave the actual
permissions checking to the system. Second guessing the security
subsystem can lead to some very odd behaviour. For example, if you
try to reimplement the kernel's file system permissions checking on
10.3.x, you would be completely out of date when 10.4 introduced ACLs.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden