• 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
Style/Design question - when and how to authorise
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Style/Design question - when and how to authorise


  • Subject: Style/Design question - when and how to authorise
  • From: ObjM2 <email@hidden>
  • Date: Wed, 27 Jul 2005 02:38:44 +0900

Hi

I have a question about best practise/style/design in relation to authorisation/pre-authorisation.

I have a class like so ...

@interface Daemon : NSObject {
@private
some parameters
AuthorizationRef authorization; // auth ref for privileged operations
}


+(id)daemonManager;

...

- (int)start;

- (int)stop;

- (int)reload;

@end

... you get the idea.

Anyway, start, stop and reload require privileges, so these need a valid authorization reference to work and this is what the instance variable "authorization" is intended for.

What I am undecided about is this ...

a) should I provide a method to preauthorise, like so ...

- (int)authorize;

which would then call the SFAuthorization functions and set the instance variable "authorization" accordingly.

or

b) should I let the start/stop/reload methods obtain an authorisation reference implicitly?

Of course either approach should work, so this is a style/design question, but I am sure that those of you who have done this kind of thing before will have valuable opinions which I would appreciate if you could share them, thanks.





___________________________________________________________ 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
  • Prev by Date: Re: NSTableView editing
  • Next by Date: Re: multi-character character constant and CFString
  • Previous by thread: Re: Exception handling help
  • Next by thread: Initializing views with models
  • Index(es):
    • Date
    • Thread