Skip navigation.
 
mlRe: Determining login privileges
FROM : Finlay Dobbie
DATE : Sun Jul 09 09:53:26 2006

On 09/07/06, Antonio Nunes <<email_removed>> wrote:
> I need to be able to determine whether my running app has the ability
> to create a folder in /Library/Application Support. I've been hunting
> for this for a couple of days now, but am not getting any closer to
> the solution.


See NSFileManager's -isWritableFileAtPath:

> I haven't found any pointers in the docs, nor online, to help
> determine either if the app can write to the desired folder or if the
> current user has admin privileges. The only thing I can think of is
> to try to create a file in the directory and see whether it fails,
> but that seems a wrong way to go about it. I'm sure there must be a
> more appropriate technique for this.


Actually, that's probably the best way to go about it.

> Alternatively I
> could always install the license file in /Library/Application
> Support, but am I correct that I then need to request authorization
> from the user and use a helper tool if the user is logged in without
> admin privileges?


Yes.

-- Finlay

Related mailsAuthorDate
mlDetermining login privileges Antonio Nunes Jul 9, 09:00
mlRe: Determining login privileges Finlay Dobbie Jul 9, 09:53