# TokenPermissions

Handles all Token Permissions (External Agents) related functionality on the Identity side

## Hierarchy

* Namespace‹[Identity](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/identity)›

  ↳ **TokenPermissions**

## Index

### Properties

* [context](#protected-context)
* [parent](#protected-parent)

### Methods

* [enabledAt](#enabledat)
* [get](#get)
* [getGroup](#getgroup)
* [getOperationHistory](#getoperationhistory)
* [hasPermissions](#haspermissions)
* [setGroup](#setgroup)
* [waive](#waive)

## Properties

### `Protected` context

• **context**: [*Context*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/context)

*Inherited from void*

*Defined in* [*src/api/entities/Namespace.ts:11*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Namespace.ts#L11)

### `Protected` parent

• **parent**: [*Identity*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/identity)

*Inherited from void*

*Defined in* [*src/api/entities/Namespace.ts:9*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Namespace.ts#L9)

## Methods

### enabledAt

▸ **enabledAt**(`__namedParameters`: object): *Promise‹*[*EventIdentifier*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/eventidentifier) *| null›*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:267*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Identity/TokenPermissions.ts#L267)

Retrieve the identifier data (block number, date and event index) of the event that was emitted when this Identity was enabled/added as an Agent with permissions over a specific Security Token

**`note`** uses the middleware

**`note`** there is a possibility that the data is not ready by the time it is requested. In that case, `null` is returned

**Parameters:**

▪ **\_\_namedParameters**: *object*

| Name    | Type                                                                                                                       |
| ------- | -------------------------------------------------------------------------------------------------------------------------- |
| `token` | string \| [SecurityToken](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/securitytoken)‹› |

**Returns:** *Promise‹*[*EventIdentifier*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/eventidentifier) *| null›*

### get

▸ **get**(): *Promise‹*[*TokenWithGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/tokenwithgroup)*\[]›*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:75*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Identity/TokenPermissions.ts#L75)

Retrieve all the Security Tokens over which this Identity has permissions, with the corresponding Permission Group

**Returns:** *Promise‹*[*TokenWithGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/tokenwithgroup)*\[]›*

### getGroup

▸ **getGroup**(`__namedParameters`: object): *Promise‹*[*CustomPermissionGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/custompermissiongroup) *|* [*KnownPermissionGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/knownpermissiongroup)*›*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:227*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Identity/TokenPermissions.ts#L227)

Retrieve this Identity's Permission Group for a specific Security Token

**Parameters:**

▪ **\_\_namedParameters**: *object*

| Name    | Type                                                                                                                       |
| ------- | -------------------------------------------------------------------------------------------------------------------------- |
| `token` | string \| [SecurityToken](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/securitytoken)‹› |

**Returns:** *Promise‹*[*CustomPermissionGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/custompermissiongroup) *|* [*KnownPermissionGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/knownpermissiongroup)*›*

### getOperationHistory

▸ **getOperationHistory**(`opts`: object): *Promise‹*[*ResultSet*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/resultset)*‹*[*EventIdentifier*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/eventidentifier)*››*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:319*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Identity/TokenPermissions.ts#L319)

Retrieve all Events triggered by Operations this Identity has performed on a specific Security Token

**`note`** uses the middleware

**`note`** supports pagination

**Parameters:**

▪ **opts**: *object*

| Name        | Type                                                                                                                     | Description               |
| ----------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------- |
| `eventId?`  | EventId                                                                                                                  | filters results by event  |
| `moduleId?` | ModuleId                                                                                                                 | filters results by module |
| `size?`     | undefined \| number                                                                                                      | page size                 |
| `start?`    | undefined \| number                                                                                                      | page offset               |
| `token`     | string \| [SecurityToken](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/securitytoken) | -                         |

**Returns:** *Promise‹*[*ResultSet*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/resultset)*‹*[*EventIdentifier*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/eventidentifier)*››*

### hasPermissions

▸ **hasPermissions**(`args`: object): *Promise‹boolean›*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:104*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Identity/TokenPermissions.ts#L104)

Check whether this Identity has specific transaction Permissions over a Security Token

**Parameters:**

▪ **args**: *object*

| Name           | Type                                                                                                                     |
| -------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `token`        | [SecurityToken](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/securitytoken) \| string |
| `transactions` | TxTag\[] \| null                                                                                                         |

**Returns:** *Promise‹boolean›*

### setGroup

▸ **setGroup**(`args`: [SetPermissionGroupParams](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/setpermissiongroupparams), `opts?`: [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/procedureopts)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/transactionqueue)*‹*[*CustomPermissionGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/custompermissiongroup) *|* [*KnownPermissionGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/knownpermissiongroup)*››*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:304*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Identity/TokenPermissions.ts#L304)

Assign this Identity to a different Permission Group for a given Security Token

**`note`** this method is of type [ProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/proceduremethod), which means you can call `setGroup.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                    |
| ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [SetPermissionGroupParams](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/setpermissiongroupparams) |
| `opts?` | [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/procedureopts)                       |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/transactionqueue)*‹*[*CustomPermissionGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/custompermissiongroup) *|* [*KnownPermissionGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/knownpermissiongroup)*››*

### waive

▸ **waive**(`args`: [WaivePermissionsParams](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/waivepermissionsparams), `opts?`: [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/procedureopts)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/transactionqueue)*‹void››*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:294*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/api/entities/Identity/TokenPermissions.ts#L294)

Abdicate from the current Permissions Group for a given Security Token. This means that this Identity will no longer have any permissions over said Token

**`note`** this method is of type [ProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/proceduremethod), which means you can call `waive.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [WaivePermissionsParams](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/waivepermissionsparams) |
| `opts?` | [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/procedureopts)                   |

**Returns:** *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/transactionqueue)*‹void››*
