Skip navigation.
 
mlRe: NSUIElement
FROM : Simon Stapleton
DATE : Sat Oct 05 18:36:15 2002

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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlNSUIElement Ben Mackin Oct 3, 21:38
mlRe: NSUIElement Olivier Oct 3, 23:01
mlRe: NSUIElement Ben Mackin Oct 4, 01:04
mlRe: NSUIElement Thomas Castiglione Oct 4, 15:40
mlRe: NSUIElement Finlay Dobbie Oct 4, 22:57
mlRe: NSUIElement Ben Mackin Oct 4, 23:12
mlRe: NSUIElement Charles Srstka Oct 4, 23:29
mlRe: NSUIElement Finlay Dobbie Oct 5, 00:02
mlRe: NSUIElement Simon Stapleton Oct 5, 18:36