init(flags:rights:environment:)
Initializes an authorization object with the specified flags, rights, and environment.
Declaration
init!(flags: AuthorizationFlags, rights: UnsafePointer<AuthorizationRights>!, environment: UnsafePointer<AuthorizationEnvironment>!)Parameters
- flags:
A bit mask for specifying authorization options. Use the following option sets:
Pass the constant Kauthorizationflagdefaults if no options are necessary.
Specify the Extendrights mask to request rights. You can also specify the Interactionallowed mask to allow user interaction.
Specify the Partialrights and Extendrights masks to request partial rights. You can also specify the Interactionallowed mask to allow user interaction.
Specify the Preauthorize and Extendrights masks to preauthorize rights.
Specify the Destroyrights mask to prevent the Security framework from preserving the rights obtained during this call.
- rights:
A pointer to a set of authorization rights you create. Pass
NULLif the application requires no rights at this time. - environment:
Data used when authorizing or preauthorizing rights. In macOS 10.3 and later, you can pass icon or prompt data to be used in the authentication dialog box. Possible values for this parameter are listed in
Security/AuthorizationTags.h. If you are not passing any data in this parameter, pass the constant Kauthorizationemptyenvironment.
Return value
The authorization object.
Discussion
You can use this method to initialize an authorization object. Normally, such initialization is not required, as you pass in flags, rights, and environmental data when you request authorization.