# AssetPermissions

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

## Hierarchy

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

  ↳ **AssetPermissions**

## Index

### Properties

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

### Methods

* [checkPermissions](#checkpermissions)
* [enabledAt](#enabledat)
* [enabledAtV2](#enabledatv2)
* [get](#get)
* [getGroup](#getgroup)
* [getOperationHistory](#getoperationhistory)
* [getOperationHistoryV2](#getoperationhistoryv2)
* [hasPermissions](#haspermissions)
* [setGroup](#setgroup)
* [waive](#waive)

## Properties

### `Protected` context

• **context**: *Context*

*Inherited from void*

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

***

### `Protected` parent

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

*Inherited from void*

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

## Methods

### checkPermissions

▸ **checkPermissions**(`args`: object): *Promise‹*[*CheckPermissionsResult*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/checkpermissionsresult.md)*‹*[*Identity*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/signertype.md#identity)*››*

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:136*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Identity/AssetPermissions.ts#L136)

Check whether this Identity has specific transaction Permissions over an Asset

**Parameters:**

▪ **args**: *object*

| Name           | Type                                                                                                      |
| -------------- | --------------------------------------------------------------------------------------------------------- |
| `asset`        | [Asset](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/asset) \| string |
| `transactions` | TxTag\[] \| null                                                                                          |

**Returns:** *Promise‹*[*CheckPermissionsResult*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/checkpermissionsresult.md)*‹*[*Identity*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/signertype.md#identity)*››*

***

### enabledAt

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:340*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Identity/AssetPermissions.ts#L340)

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 Asset

**`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                                                                                                        |
| ------- | ----------------------------------------------------------------------------------------------------------- |
| `asset` | string \| [Asset](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/asset)‹› |

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

***

### enabledAtV2

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:365*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Identity/AssetPermissions.ts#L365)

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 Asset

**`note`** uses the middlewareV2

**`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                                                                                                        |
| ------- | ----------------------------------------------------------------------------------------------------------- |
| `asset` | string \| [Asset](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/asset)‹› |

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

***

### get

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:107*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Identity/AssetPermissions.ts#L107)

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

**Returns:** *Promise‹*[*AssetWithGroup*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/assetwithgroup.md)*\[]›*

***

### getGroup

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

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

Retrieve this Identity's Permission Group for a specific Asset

**Parameters:**

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

| Name    | Type                                                                                                        |
| ------- | ----------------------------------------------------------------------------------------------------------- |
| `asset` | string \| [Asset](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/asset)‹› |

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

***

### getOperationHistory

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:415*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Identity/AssetPermissions.ts#L415)

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

**`note`** uses the middleware

**`note`** supports pagination

**Parameters:**

▪ **opts**: *object*

| Name        | Type                                                                                                      | Description               |
| ----------- | --------------------------------------------------------------------------------------------------------- | ------------------------- |
| `asset`     | string \| [Asset](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/asset) | -                         |
| `eventId?`  | EventId                                                                                                   | filters results by event  |
| `moduleId?` | ModuleId                                                                                                  | filters results by module |
| `size?`     | BigNumber                                                                                                 | page size                 |
| `start?`    | BigNumber                                                                                                 | page offset               |

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

***

### getOperationHistoryV2

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:500*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Identity/AssetPermissions.ts#L500)

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

**`note`** uses the middlewareV2

**`note`** supports pagination

**Parameters:**

▪ **opts**: *object*

| Name        | Type                                                                                                      | Description               |
| ----------- | --------------------------------------------------------------------------------------------------------- | ------------------------- |
| `asset`     | string \| [Asset](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/asset) | -                         |
| `eventId?`  | EventId                                                                                                   | filters results by event  |
| `moduleId?` | ModuleId                                                                                                  | filters results by module |
| `size?`     | BigNumber                                                                                                 | page size                 |
| `start?`    | BigNumber                                                                                                 | page offset               |

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

***

### hasPermissions

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:288*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Identity/AssetPermissions.ts#L288)

Check whether this Identity has specific transaction Permissions over an Asset

**`deprecated`** in favor of `checkPermissions`

**Parameters:**

▪ **args**: *object*

| Name           | Type                                                                                                      |
| -------------- | --------------------------------------------------------------------------------------------------------- |
| `asset`        | [Asset](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/asset) \| string |
| `transactions` | TxTag\[] \| null                                                                                          |

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

***

### setGroup

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:400*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Identity/AssetPermissions.ts#L400)

Assign this Identity to a different Permission Group for a given Asset

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [setGroup.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                                   |
| ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [SetPermissionGroupParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/setpermissiongroupparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)                       |

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

***

### waive

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:390*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Identity/AssetPermissions.ts#L390)

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

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md), which means you can call [waive.checkAuthorization](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/proceduremethod.md#checkauthorization) on it to see whether the signing Account and Identity have the required roles and permissions to run it

**Parameters:**

| Name    | Type                                                                                                                               |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `args`  | [WaivePermissionsParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/waivepermissionsparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/procedureopts.md)                   |

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