Re: User Installed Resouces (Admin Access)
Re: User Installed Resouces (Admin Access)
- Subject: Re: User Installed Resouces (Admin Access)
- From: "Finlay Dobbie" <email@hidden>
- Date: Fri, 21 Sep 2007 21:20:04 +0100
On 21/09/2007, Stefan Arentz <email@hidden> wrote:
> The admin group has write permission to /Library/Application Support.
> To determine if the current user has the right permission you could
> use getgrent("admin") to discover the members of the admin group.
>
> Pseudo code:
>
> current_user = getpwent();
> group = getgrnam("admin")
> if group.gr_mem contains current_user.pw_name then we are an admin
Technically I don't think this will necessarily work any more due to
nested groups etc. You should use the mbr_* API to check group
membership as of Tiger :o)
-- Finlay
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden