# AssetPermissions

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

## Hierarchy

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

  ↳ **AssetPermissions**

## Index

### Properties

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

### Methods

* [checkPermissions](#checkpermissions)
* [enabledAt](#enabledat)
* [get](#get)
* [getGroup](#getgroup)
* [getOperationHistory](#getoperationhistory)
* [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/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Namespace.ts#L11)

***

### `Protected` parent

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

*Inherited from void*

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

## Methods

### checkPermissions

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:133*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Identity/AssetPermissions.ts#L133)

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/classes/asset) \| string |
| `transactions` | TxTag\[] \| null                                                                                |

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

***

### enabledAt

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:337*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Identity/AssetPermissions.ts#L337)

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/classes/asset)‹› |

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

***

### get

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:104*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Identity/AssetPermissions.ts#L104)

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

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

***

### getGroup

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:297*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Identity/AssetPermissions.ts#L297)

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/classes/asset)‹› |

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

***

### getOperationHistory

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:386*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Identity/AssetPermissions.ts#L386)

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/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/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/resultset.md)*‹*[*EventIdentifier*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/eventidentifier.md)*››*

***

### hasPermissions

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:285*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Identity/AssetPermissions.ts#L285)

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/classes/asset) \| string |
| `transactions` | TxTag\[] \| null                                                                                |

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

***

### setGroup

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:371*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Identity/AssetPermissions.ts#L371)

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

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/proceduremethod.md), which means you can call [setGroup.checkAuthorization](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/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/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/setpermissiongroupparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/procedureopts.md)                       |

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

***

### waive

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

*Defined in* [*src/api/entities/Identity/AssetPermissions.ts:361*](https://github.com/PolymeshAssociation/polymesh-sdk/blob/46845947/src/api/entities/Identity/AssetPermissions.ts#L361)

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/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/proceduremethod.md), which means you can call [waive.checkAuthorization](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/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/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/waivepermissionsparams.md) |
| `opts?` | [ProcedureOpts](https://github.com/PolymeshAssociation/polymesh-sdk/blob/docs/v14/docs/interfaces/procedureopts.md)                   |

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