13 #ifndef MAC_AUTHORIZATION_H
14 #define MAC_AUTHORIZATION_H
18 #if defined(__APPLE__)
24 namespace macos {
namespace internal {
26 class AuthorizationPrivate;
35 ErrAuthorizationUnknown = -1,
36 ErrAuthorizationSuccess = 0,
37 ErrAuthorizationCanceled = 1,
38 ErrAuthorizationDenied = 2,
39 ErrAuthorizationToolExecuteFailure = 3,
40 ErrAuthorizationToolEnvironmentError = 4
Authorization framework encapsulation.
void setPrompt(const std::string &prompt)
Set prompt used when no prompt is provided with a function call (UTF8)
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)
const std::string & getCommandOutput() const
return a reference to the stdout output string of the command last executed
AuthorizationError
Authorization error codes.
Authorization(const std::string &prompt=std::string())
C-tor (Optionally set a prompt used when no prompt is provided with a function call)
#define OSXSUPPORT_PUBLIC_API
Symbol visibility macros.
#define OSXSUPPORT_PRIVATE_API