# 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](/polymesh-sdk-api-reference/docs-beta/classes/asset.md)›

  ↳ **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*](/polymesh-sdk-api-reference/docs-beta/classes/asset.md)*› | 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*](/polymesh-sdk-api-reference/docs-beta/classes/asset.md)

*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*](/polymesh-sdk-api-reference/docs-beta/classes/defaultportfolio.md) *|* [*NumberedPortfolio*](/polymesh-sdk-api-reference/docs-beta/classes/numberedportfolio.md)*› | 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*](/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue.md)*‹*[*CustomPermissionGroup*](/polymesh-sdk-api-reference/docs-beta/classes/custompermissiongroup.md)*››*

*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*](/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue.md)*‹*[*CustomPermissionGroup*](/polymesh-sdk-api-reference/docs-beta/classes/custompermissiongroup.md)*››*

***

### 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*](/polymesh-sdk-api-reference/docs-beta/classes/custompermissiongroup.md)*›*

*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*](/polymesh-sdk-api-reference/docs-beta/classes/custompermissiongroup.md)*›*

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

*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*](/polymesh-sdk-api-reference/docs-beta/classes/knownpermissiongroup.md)*›*

***

### 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*](/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue.md)*‹*[*AuthorizationRequest*](/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest.md)*››*

*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](/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest.md) 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](/polymesh-sdk-api-reference/docs-beta/classes/authorizations.md#getreceived). Also, an Account or Identity can directly fetch the details of an Authorization Request by calling [authorizations.getOne](/polymesh-sdk-api-reference/docs-beta/classes/authorizations.md#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*](/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue.md)*‹*[*AuthorizationRequest*](/polymesh-sdk-api-reference/docs-beta/classes/authorizationrequest.md)*››*

***

### 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*](/polymesh-sdk-api-reference/docs-beta/classes/transactionqueue.md)*‹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*](/polymesh-sdk-api-reference/docs-beta/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/docs-beta/classes/permissions.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.
