[**Documentation**](../../../README)

***

[Documentation](../../../README) / [zerotal](../../README) / [auth](../README) / AuthorizationDenied

# Class: AuthorizationDenied

Defined in: [packages/auth/src/events.ts:154](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/auth/src/events.ts#L154)

Emitted when an authorization check denies access; `ability` is the gate or
policy ability that failed.

## Constructors

### Constructor

> **new AuthorizationDenied**(`ability`, `userId`, `ctx`): `AuthorizationDenied`

Defined in: [packages/auth/src/events.ts:155](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/auth/src/events.ts#L155)

#### Parameters

##### ability

`string`

##### userId

`string` \| `number` \| `undefined`

##### ctx

`object` \| `undefined`

#### Returns

`AuthorizationDenied`

## Properties

### ability

> `readonly` **ability**: `string`

Defined in: [packages/auth/src/events.ts:156](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/auth/src/events.ts#L156)

***

### userId

> `readonly` **userId**: `string` \| `number` \| `undefined`

Defined in: [packages/auth/src/events.ts:157](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/auth/src/events.ts#L157)

***

### ctx

> `readonly` **ctx**: `object` \| `undefined`

Defined in: [packages/auth/src/events.ts:158](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/auth/src/events.ts#L158)
