# Common Protos for Google Cloud APIs Client - Class AuthorizationInfo (1.0.0)

1.0.0 (latest) 0.8.3 0.7.0 0.6.0 0.5.2 0.4.2 0.3.8 Reference documentation and code samples for the Common Protos for Google Cloud APIs Client class AuthorizationInfo.

Authorization information for the operation.

Generated from protobuf message `google.cloud.audit.AuthorizationInfo`

## Namespace

Google \\ Cloud \\ Audit

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ resource` | `string` The resource being accessed, as a REST-style or cloud resource string. For example: bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID or projects/PROJECTID/datasets/DATASETID |
| `↳ permission` | `string` The required IAM permission. |
| `↳ granted` | `bool` Whether or not authorization for `resource` and `permission` was granted. |
| `↳ resource_attributes` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Context.AttributeContext.Resource.html` Resource attributes used in IAM condition evaluation. This field contains resource attributes like resource type and resource name. To get the whole view of the attributes used in IAM condition evaluation, the user must also look into `AuditLog.request_metadata.request_attributes`. |
| `↳ permission_type` | `int` The type of the permission that was checked. For data access audit logs this corresponds with the permission type that must be enabled in the project/folder/organization IAM policy in order for the log to be written. |

### getResource

The resource being accessed, as a REST-style or cloud resource string.

For example:
bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
or
projects/PROJECTID/datasets/DATASETID

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setResource

The resource being accessed, as a REST-style or cloud resource string.

For example:
bigquery.googleapis.com/projects/PROJECTID/datasets/DATASETID
or
projects/PROJECTID/datasets/DATASETID

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPermission

The required IAM permission.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setPermission

The required IAM permission.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGranted

Whether or not authorization for `resource` and `permission`
was granted.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setGranted

Whether or not authorization for `resource` and `permission`
was granted.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getResourceAttributes

Resource attributes used in IAM condition evaluation. This field contains
resource attributes like resource type and resource name.

To get the whole view of the attributes used in IAM
condition evaluation, the user must also look into
`AuditLog.request_metadata.request_attributes`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Context.AttributeContext.Resource.html|null` |   |

### hasResourceAttributes

### clearResourceAttributes

### setResourceAttributes

Resource attributes used in IAM condition evaluation. This field contains
resource attributes like resource type and resource name.

To get the whole view of the attributes used in IAM
condition evaluation, the user must also look into
`AuditLog.request_metadata.request_attributes`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Context.AttributeContext.Resource.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPermissionType

The type of the permission that was checked. For data access audit logs
this corresponds with the permission type that must be enabled in the
project/folder/organization IAM policy in order for the log to be written.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [PermissionType](https://docs.cloud.google.com/php/docs/reference/cloud-common-protos/latest/Audit.AuthorizationInfo.PermissionType). |

### setPermissionType

The type of the permission that was checked. For data access audit logs
this corresponds with the permission type that must be enabled in the
project/folder/organization IAM policy in order for the log to be written.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [PermissionType](https://docs.cloud.google.com/php/docs/reference/cloud-common-protos/latest/Audit.AuthorizationInfo.PermissionType). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |