• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to find the logged in user is Admin or Standard user?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to find the logged in user is Admin or Standard user? (From: "sunil prajapati" <email@hidden>)

  • Prev by Date: How to find the logged in user is Admin or Standard user?
  • Next by Date: Why is my Mac on the web when I'm not?
  • Previous by thread: How to find the logged in user is Admin or Standard user?
  • Next by thread: Why is my Mac on the web when I'm not?
  • Index(es):
    • Date
    • Thread