Structure

AuthorizationItem

A structure containing information about an authorization right or the authorization environment.

Declaration

struct AuthorizationItem

Overview

When using an authorization item to contain a right, set the name field to the name of the right—for example, "com.myOrganization.myProduct.myRight", the valueLength and flags fields to 0, and the value field to NULL. For more information on naming rights, read Authorization Services Programming Guide

When using an authorization item for the AuthorizationExecuteWithPrivileges function, set the name field to kAuthorizationRightExecute, and the flags field to 0. Set the value field to the full POSIX pathname of the tool to execute and the valueLength field to the byte length of the value in the value field.

When using an authorization item to contain environment data, set the name field to the name of the environment data—for example, kAuthorizationEnvironmentUsername—and the flags field to 0. Set the value field, in this case, to the actual user name and the valueLength field to the byte length of the value in the value field.

Topics

Instance Properties

var name: AuthorizationString

The required name of the authorization right or environment data.

var valueLength: Int

The number of bytes in the value field.

var value: UnsafeMutableRawPointer?

A pointer to information pertaining to the name field.

var flags: UInt32

Reserved option bits.

See Also

Authorization Items

struct AuthorizationItemSet

A structure containing a set of authorization items.

typealias AuthorizationRights

An authorization item set designated to represent a set of rights.

typealias AuthorizationEnvironment

An authorization item set designated to hold environment information relevant to authorization decisions.

Authorization Name Tags

Use name tags to define authorization security items.

func AuthorizationFreeItemSet(UnsafeMutablePointer<AuthorizationItemSet>) -> OSStatus

Frees the memory associated with a set of authorization items.