# Permissions

Permissions a Secondary Key has over the Identity. A null value means the key has all permissions of that type (i.e. if `assets` is null, the key has permissions over all of the Identity's Assets) Handles all Asset Permissions related functionality

## Hierarchy

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

  ↳ **Permissions**

## Index

### Properties

* [assets](#assets)
* [context](#protected-context)
* [parent](#protected-parent)
* [portfolios](#portfolios)
* [transactionGroups](#transactiongroups)
* [transactions](#transactions)

### Methods

* [createGroup](#creategroup)
* [getAgents](#getagents)
* [getGroup](#getgroup)
* [getGroups](#getgroups)
* [inviteAgent](#inviteagent)
* [removeAgent](#removeagent)

## Properties

### assets

• **assets**: [*SectionPermissions*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/sectionpermissions.md)*‹*[*Asset*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/asset)*› | null*

*Defined in* [*src/types/index.ts:917*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/types/index.ts#L917)

Assets over which this key has permissions

***

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

*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)

***

### portfolios

• **portfolios**: [*SectionPermissions*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/sectionpermissions.md)*‹*[*DefaultPortfolio*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/defaultportfolio) *|* [*NumberedPortfolio*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/numberedportfolio)*› | null*

*Defined in* [*src/types/index.ts:931*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/types/index.ts#L931)

***

### transactionGroups

• **transactionGroups**: [*TxGroup*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/txgroup.md)*\[]*

*Defined in* [*src/types/index.ts:929*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/types/index.ts#L929)

list of Transaction Groups this key can execute. Having permissions over a TxGroup means having permissions over every TxTag in said group. Partial group permissions are not covered by this value. For a full picture of transaction permissions, see the `transactions` property

NOTE: If transactions is null, ignore this value

***

### transactions

• **transactions**: [*TransactionPermissions*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/transactionpermissions.md) *| null*

*Defined in* [*src/types/index.ts:921*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/types/index.ts#L921)

Transactions this key can execute

## Methods

### createGroup

▸ **createGroup**(`args`: [CreateGroupParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/creategroupparams.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)*››*

*Defined in* [*src/api/entities/Asset/Permissions.ts:70*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Asset/Permissions.ts#L70)

Create a Permission Group for this Asset. Identities can be assigned to Permission Groups as agents. Agents assigned to a Permission Group have said group's permissions over the 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 [createGroup.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`  | [CreateGroupParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/creategroupparams.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)*››*

***

### getAgents

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

*Defined in* [*src/api/entities/Asset/Permissions.ts:171*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Asset/Permissions.ts#L171)

Retrieve a list of agents (Identities which have permissions over the Asset) and their respective Permission Groups

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

***

### getGroup

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

*Defined in* [*src/api/entities/Asset/Permissions.ts:104*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Asset/Permissions.ts#L104)

Retrieve a single Permission Group by its ID (or type). Passing an ID will fetch a Custom Permission Group, while passing a type will fetch a Known Permission Group

**`throws`** if there is no Permission Group with the passed ID

**Parameters:**

▪ **args**: *object*

| Name | Type      |
| ---- | --------- |
| `id` | BigNumber |

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

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

*Defined in* [*src/api/entities/Asset/Permissions.ts:105*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Asset/Permissions.ts#L105)

**Parameters:**

▪ **args**: *object*

| Name   | Type                                                                                                                    |
| ------ | ----------------------------------------------------------------------------------------------------------------------- |
| `type` | [PermissionGroupType](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/permissiongrouptype.md) |

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

***

### getGroups

▸ **getGroups**(): *Promise‹*[*PermissionGroups*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/permissiongroups.md)*›*

*Defined in* [*src/api/entities/Asset/Permissions.ts:137*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Asset/Permissions.ts#L137)

Retrieve all Permission Groups of this Asset

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

***

### inviteAgent

▸ **inviteAgent**(`args`: [InviteExternalAgentParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/inviteexternalagentparams.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)*‹*[*AuthorizationRequest*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest)*››*

*Defined in* [*src/api/entities/Asset/Permissions.ts:84*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Asset/Permissions.ts#L84)

Invite an Identity to be an agent with permissions over this Asset

**`note`** this will create an [Authorization Request](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest) which has to be accepted by the `target` Identity. An [Account](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/signertype.md#account) or [Identity](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/enums/roletype.md#identity) can fetch its pending Authorization Requests by calling [authorizations.getReceived](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/authorizations#getreceived). Also, an Account or Identity can directly fetch the details of an Authorization Request by calling [authorizations.getOne](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/authorizations#getone)

**`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 [inviteAgent.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`  | [InviteExternalAgentParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/inviteexternalagentparams.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)*‹*[*AuthorizationRequest*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest)*››*

***

### removeAgent

▸ **removeAgent**(`args`: [RemoveExternalAgentParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/removeexternalagentparams.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/Asset/Permissions.ts:94*](https://github.com/PolymathNetwork/polymesh-sdk/blob/31a16a34/src/api/entities/Asset/Permissions.ts#L94)

Revoke an agent's permissions over this 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 [removeAgent.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`  | [RemoveExternalAgentParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/beta/docs/interfaces/removeexternalagentparams.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››*
