# TokenPermissions

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

## Hierarchy

* Namespace‹[Identity](/polymesh-sdk-api-reference/v12.0.2/classes/identity.md)›

  ↳ **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*](/polymesh-sdk-api-reference/v12.0.2/classes/context.md)

*Inherited from void*

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

***

### `Protected` parent

• **parent**: [*Identity*](/polymesh-sdk-api-reference/v12.0.2/classes/identity.md)

*Inherited from void*

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

## Methods

### enabledAt

▸ **enabledAt**(`__namedParameters`: object): *Promise‹*[*EventIdentifier*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/eventidentifier.md) *| null›*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:263*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/api/entities/Identity/TokenPermissions.ts#L263)

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](/polymesh-sdk-api-reference/v12.0.2/classes/securitytoken.md)‹› |

**Returns:** *Promise‹*[*EventIdentifier*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/eventidentifier.md) *| null›*

***

### get

▸ **get**(): *Promise‹*[*TokenWithGroup*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/tokenwithgroup.md)*\[]›*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:75*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/tokenwithgroup.md)*\[]›*

***

### getGroup

▸ **getGroup**(`__namedParameters`: object): *Promise‹*[*CustomPermissionGroup*](/polymesh-sdk-api-reference/v12.0.2/classes/custompermissiongroup.md) *|* [*KnownPermissionGroup*](/polymesh-sdk-api-reference/v12.0.2/classes/knownpermissiongroup.md)*›*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:223*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/api/entities/Identity/TokenPermissions.ts#L223)

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

**Parameters:**

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

| Name    | Type                                                                                      |
| ------- | ----------------------------------------------------------------------------------------- |
| `token` | string \| [SecurityToken](/polymesh-sdk-api-reference/v12.0.2/classes/securitytoken.md)‹› |

**Returns:** *Promise‹*[*CustomPermissionGroup*](/polymesh-sdk-api-reference/v12.0.2/classes/custompermissiongroup.md) *|* [*KnownPermissionGroup*](/polymesh-sdk-api-reference/v12.0.2/classes/knownpermissiongroup.md)*›*

***

### getOperationHistory

▸ **getOperationHistory**(`opts`: object): *Promise‹*[*ResultSet*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/resultset.md)*‹*[*EventIdentifier*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/eventidentifier.md)*››*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:315*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/api/entities/Identity/TokenPermissions.ts#L315)

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](/polymesh-sdk-api-reference/v12.0.2/classes/securitytoken.md) | -                         |

**Returns:** *Promise‹*[*ResultSet*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/resultset.md)*‹*[*EventIdentifier*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/eventidentifier.md)*››*

***

### hasPermissions

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

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:104*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/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](/polymesh-sdk-api-reference/v12.0.2/classes/securitytoken.md) \| string |
| `transactions` | TxTag\[] \| null                                                                        |

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

***

### setGroup

▸ **setGroup**(`args`: [SetPermissionGroupParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/setpermissiongroupparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/v12.0.2/classes/transactionqueue.md)*‹*[*CustomPermissionGroup*](/polymesh-sdk-api-reference/v12.0.2/classes/custompermissiongroup.md) *|* [*KnownPermissionGroup*](/polymesh-sdk-api-reference/v12.0.2/classes/knownpermissiongroup.md)*››*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:300*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/api/entities/Identity/TokenPermissions.ts#L300)

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

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/proceduremethod.md), 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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/setpermissiongroupparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/procedureopts.md)                       |

**Returns:** *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/v12.0.2/classes/transactionqueue.md)*‹*[*CustomPermissionGroup*](/polymesh-sdk-api-reference/v12.0.2/classes/custompermissiongroup.md) *|* [*KnownPermissionGroup*](/polymesh-sdk-api-reference/v12.0.2/classes/knownpermissiongroup.md)*››*

***

### waive

▸ **waive**(`args`: [WaivePermissionsParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/waivepermissionsparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/v12.0.2/classes/transactionqueue.md)*‹void››*

*Defined in* [*src/api/entities/Identity/TokenPermissions.ts:290*](https://github.com/PolymathNetwork/polymesh-sdk/blob/44d12f59/src/api/entities/Identity/TokenPermissions.ts#L290)

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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/proceduremethod.md), 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://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/waivepermissionsparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v12/docs/interfaces/procedureopts.md)                   |

**Returns:** *Promise‹*[*TransactionQueue*](/polymesh-sdk-api-reference/v12.0.2/classes/transactionqueue.md)*‹void››*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.polymath.network/polymesh-sdk-api-reference/v12.0.2/classes/tokenpermissions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
