Platforms to show: All Mac Windows Linux Cross-Platform
AuthorizationMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Authorization | MBS MacCF Plugin | 2.8 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Some notes from Ilija Injac on this usage of this class:
The main problem for the execution of the perl script was, that perl is not able to find the required perl-modules at execution with the option "-U" (this switch is set for security reasons).
It was also neccessary to include the perl-modules from inside the perl script wich has to be executed.
Inside the Xojo code i created a AuthorizationItemMBS with the value "/usr/bin/perl":
...
i = new AuthorizationItemMBS
i.name | = a.kAuthorizationItemRightExecute |
i.value | = "/usr/bin/perl" |
Actually it is the same source as in Christians "Authorization 1" example within the "test1" function. And it works !
- 5 properties
- property Authorized as Boolean
- property Handle as Integer
- property KeepRights as Boolean
- property LastError as Integer
- property StreamHandle as Integer
- 19 methods
- method Authorize(rights as AuthorizationItemSetMBS, flags as Integer)
- method Authorize(rights as AuthorizationItemSetMBS, flags as Integer, byref outrights as AuthorizationItemSetMBS)
- method Available as boolean
- method close
- method closeStream
- method EOFStream as boolean
- method Execute(toolpath as string, parameters() as string)
- method Execute(toolpath as string, parameters() as string, openstream as boolean)
- method ExternalForm as string
- method FlushStream
- method Info as AuthorizationItemSetMBS
- method MakeStreamAsyncron
- method NewAuthorization(rights as AuthorizationItemSetMBS, flags as Integer) as Boolean
- method NewAuthorizationFromExternalForm(s as string) as Boolean
- method ReadStream(count as Integer) as string
- method SimpleAuthorize
- method SimpleNewAuthorization as Boolean
- method Wait as Integer
- method WriteStream(s as string) as Integer
- 23 constants
Constants
Constant | Value | Description |
---|---|---|
kAuthorizationEmptyEnvironment | nil | Indicates an empty environment. You should pass this constant in functions with an environment parameter if you have no environment data to provide. |
kAuthorizationExternalFormLength | 32 | Indicates, in number of bytes, the length of the array in the AuthorizationExternalForm structure. |
Error Codes
Constant | Value | Description |
---|---|---|
errAuthorizationCanceled | -60006 |
The authorization was cancelled by the user. |
errAuthorizationDenied | -60005 |
The authorization was denied. |
errAuthorizationExternalizeNotAllowed | -60009 |
The authorization is not allowed to be converted to an external format. |
errAuthorizationInteractionNotAllowed | -60007 |
The authorization was denied since no user interaction was possible. |
errAuthorizationInternal | -60008 |
Unable to obtain authorization for this operation. |
errAuthorizationInternalizeNotAllowed | -60010 |
The authorization is not allowed to be created from an external format. |
errAuthorizationInvalidFlags | -60011 |
The provided option flag(s) are invalid for this authorization operation. |
errAuthorizationInvalidPointer | -60004 |
The returned authorization is invalid. |
errAuthorizationInvalidRef | -60002 |
The authorization reference is invalid. |
errAuthorizationInvalidSet | -60001 |
The authorization rights are invalid. |
errAuthorizationInvalidTag | -60003 |
The authorization tag is invalid. |
errAuthorizationSuccess | 0 |
No error. |
errAuthorizationToolEnvironmentError | -60032 |
An invalid status was returned during execution of a privileged tool. |
errAuthorizationToolExecuteFailure | -60031 |
The specified program could not be executed. |
Flag values
Constant | Value | Description |
---|---|---|
kAuthorizationFlagCanNotPreAuthorize | 1 |
Indicates the Security Server could not preauthorize the right. |
kAuthorizationFlagDefaults | 0 |
If no bits are set, none of the following features are available. |
kAuthorizationFlagDestroyRights | 8 |
If the bit specified by this mask is set, the Security Server revokes authorization from the process as well as from any other process that is sharing the authorization. If the bit specified by this mask is not set, the Security Server revokes authorization from the process but not from other processes that share the authorization. |
kAuthorizationFlagExtendRights | 2 |
If the bit specified by this mask is set, the Security Server attempts to grant the rights requested. Once the Security Server denies one right, it ignores the remaining requested rights. |
kAuthorizationFlagInteractionAllowed | 1 |
If the bit specified by this mask is set, you permit the Security Server to interact with the user when necessary. |
kAuthorizationFlagPartialRights | 4 |
If the bit specified by this mask and the kAuthorizationFlagExtendRights mask are set, the Security Server grants or denies rights on an individual basis and all rights are checked. |
kAuthorizationFlagPreAuthorize | 16 |
If the bit specified by this mask is set, the Security Server preauthorizes the rights requested. |
This class has no sub classes.
Some methods using this class:
- ServiceManagementModuleMBS.CreateAuthorization as AuthorizationMBS
- ServiceManagementModuleMBS.JobBless(domain as string, executableLabel as string, auth as AuthorizationMBS, byref error as Variant) as boolean
- ServiceManagementModuleMBS.JobRemove(domain as string, jobLabel as string, auth as AuthorizationMBS, wait as boolean, byref error as CFErrorMBS) as boolean
- ServiceManagementModuleMBS.JobSubmit(domain as string, job as Dictionary, auth as AuthorizationMBS, byref error as CFErrorMBS) as boolean
Some examples using this class:
- /MacCF/Authorization/Authorization with Stream
- /MacCF/Authorization/Authorization with Stream Async
- /MacCF/SMJobBless in Xojo/MainApp
Blog Entries
- MBS Xojo Plugins, version 20.5pr8
- MBS Xojo Plugins, version 17.3pr5
- MBS Xojo Plugins, version 17.3pr4
- MBS Xojo / Real Studio Plugins, version 14.2pr5
Release notes
- Version 20.5
- Optimized a few more flags: iTunesLibraryMBS, GrowlMBS, AuthorizationMBS, SUUpdaterMBS, SpinningProgressIndicatorMBS, NSHelpManagerMBS and MAAttachedWindowMBS classes are now desktop only.
- Version 17.3
- Fixed crash with 64-bit for Execute methods in AuthorizationMBS class.
The items on this page are in the following plugins: MBS MacCF Plugin.
AuthorizationItemSetMBS - AvahiBrowserMBS