Re: NSUIElement
Re: NSUIElement
- Subject: Re: NSUIElement
- From: Simon Stapleton <email@hidden>
- Date: Sat, 5 Oct 2002 18:36:15 +0200
On Friday, October 4, 2002, at 10:12 pm, Ben Mackin wrote:
Ok, then what I will do is disable the option to switch if they are
not the
admin. How does one check if the current user has admin privileges, or
if
they are a "normal" user?
Wrong question. The question is not 'are they admin?', or even 'do
they have admin priviledges?', but 'are they able they carry out the
modification we want to do?'. And to do this, you'll want something
like:
NSString * plistPath = nil;
BOOL isPlistWritable = NO;
if (plistPath = [[NSBundle mainBundle] pathForResource:@"Info"
ofType:@"plist"]) {
isPlistWritable = [[NSFileManager defaultManager]
isFileWritableAtPath:plistPath];
}
// Now check isPlistWritable and carry out the appropriate actions.
Hope that helps
Simon
--
PGP Key Id : 0x50D0698D
--
Your mouse has moved. You must restart Windows NT for this change to
be recognised.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.