• 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
How do you use AuthorizationRuleIsAdmin?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How do you use AuthorizationRuleIsAdmin?


  • Subject: How do you use AuthorizationRuleIsAdmin?
  • From: BK <email@hidden>
  • Date: Wed, 27 Jul 2005 15:51:12 +0900

Hi there,

I am struggling to comprehend Apple's Authorization Services framework which is far too complex for what I want to do and that complexity is getting in the way of even starting off with something simple.

What I want to do is let a user restart a daemon - that's it.

All I care about is "did the user authenticate as an admin user - YES or NO?"

Anything else is totally and utterly irrelevant.


My question is this:

How do I initialise an authorisation reference that I can pass to AuthorizationExecuteWithPrivileges (to tell the daemon to restart) such that it only executes if the user has authenticated himself as an admin user?

I spotted there is a built-in rule AuthorizationRuleIsAdmin, but there are no examples how to use it. As it is a constant, it cannot be passed to the functions which expect rights as a parameter because the rights are always pointers.

I tried to follow the examples in Apple's documentation, but they are all far too complex and I cannot seem to extract the 0.00001% that's really needed for a simple daemon restart scenario. The whole rights and policy database stuff has me totally confused. The sample authapp project I downloaded from Apple freezes Xcode, and it contains a strange undefined type that isn't declared nor documented anywhere, yet more confusion.

I'd appreciate if somebody could untangle this for me, thanks a lot.
regards
bk





___________________________________________________________ Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: How do you use AuthorizationRuleIsAdmin?
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: NSTableView and Custom Highlight Functions
  • Next by Date: Window Closing Behavior
  • Previous by thread: NSTableView and Custom Highlight Functions
  • Next by thread: Re: How do you use AuthorizationRuleIsAdmin?
  • Index(es):
    • Date
    • Thread