1 // ====================================================================== //
2 // BLAuthentication.h //
4 // Last Modified on Tuesday April 24 2001 //
5 // Copyright 2001 Ben Lachman //
7 // Thanks to Brian R. Hill <http://personalpages.tds.net/~brian_hill/> //
8 // ====================================================================== //
10 #import <Cocoa/Cocoa.h>
11 #import <Security/Authorization.h>
13 @interface BLAuthentication
: NSObject
15 AuthorizationRef authorizationRef
;
17 // returns a shared instance of the class
19 // checks if user is authentcated forCommands
20 - (BOOL
)isAuthenticated
:(NSArray
*)forCommands
;
21 // authenticates user forCommands
22 - (BOOL
)authenticate
:(NSArray
*)forCommands
;
23 // deauthenticates user
24 - (void)deauthenticate
;
25 // gets the pid forProcess
26 - (int)getPID
:(NSString
*)forProcess
;
27 // executes pathToCommand with privileges
28 - (BOOL
)executeCommand
:(NSString
*)pathToCommand withArgs
:(NSArray
*)arguments
;
29 // kills the process specified by commandFromPS
30 - (BOOL
)killProcess
:(NSString
*)commandFromPS
;
33 // strings for notification center
34 extern NSString
* BLAuthenticatedNotification
;
35 extern NSString
* BLDeauthenticatedNotification
;