MeVisLab Toolbox Reference
|
Authorization framework encapsulation. More...
#include <macAuthorization.h>
Public Types | |
enum | AuthorizationError { ErrAuthorizationUnknown = -1 , ErrAuthorizationSuccess = 0 , ErrAuthorizationCanceled = 1 , ErrAuthorizationDenied = 2 , ErrAuthorizationToolExecuteFailure = 3 , ErrAuthorizationToolEnvironmentError = 4 } |
Authorization error codes. More... | |
Public Member Functions | |
Authorization (const std::string &prompt=std::string()) | |
C-tor (Optionally set a prompt used when no prompt is provided with a function call) More... | |
~Authorization () | |
D-tor. More... | |
void | setPrompt (const std::string &prompt) |
Set prompt used when no prompt is provided with a function call (UTF8) More... | |
bool | executeWithPrivileges (const std::string &cmd, const std::list< std::string > &argv, const std::string &prompt=std::string(), AuthorizationError *error=NULL) |
execute cmd including arguments with privileges (UTF8) More... | |
const std::string & | getCommandOutput () const |
return a reference to the stdout output string of the command last executed More... | |
Authorization framework encapsulation.
Definition at line 29 of file macAuthorization.h.
Authorization error codes.
Definition at line 34 of file macAuthorization.h.
macos::internal::Authorization::Authorization | ( | const std::string & | prompt = std::string() | ) |
C-tor (Optionally set a prompt used when no prompt is provided with a function call)
macos::internal::Authorization::~Authorization | ( | ) |
D-tor.
bool macos::internal::Authorization::executeWithPrivileges | ( | const std::string & | cmd, |
const std::list< std::string > & | argv, | ||
const std::string & | prompt = std::string() , |
||
AuthorizationError * | error = NULL |
||
) |
execute cmd including arguments with privileges (UTF8)
calling the function multiple times will reuse an existing authorization reference. Hence, an instance of this class should be used to authorize calls that "belong together", in the sense that the user should consider them a single security event. If they are meant to be separate, so that a user could meaningfully approve one but decline another, you should use separate instances.
const std::string& macos::internal::Authorization::getCommandOutput | ( | ) | const |
return a reference to the stdout output string of the command last executed
void macos::internal::Authorization::setPrompt | ( | const std::string & | prompt | ) |
Set prompt used when no prompt is provided with a function call (UTF8)
The prompt string is used in the authentication dialog box.