# Permissions

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

## Hierarchy

* Namespace‹[SecurityToken](https://developers.polymath.network/polymesh-sdk-api-reference/v11.0.2/classes/securitytoken)›

  ↳ **Permissions**

## Index

### Properties

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

### Methods

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

## Properties

### `Protected` context

• **context**: [*Context*](https://developers.polymath.network/polymesh-sdk-api-reference/v11.0.2/classes/context)

*Inherited from void*

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

***

### `Protected` parent

• **parent**: [*SecurityToken*](https://developers.polymath.network/polymesh-sdk-api-reference/v11.0.2/classes/securitytoken)

*Inherited from void*

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

***

### portfolios

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

*Defined in* [*src/types/index.ts:793*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/types/index.ts#L793)

***

### tokens

• **tokens**: [*SectionPermissions*](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/sectionpermissions.md)*‹*[*SecurityToken*](https://developers.polymath.network/polymesh-sdk-api-reference/v11.0.2/classes/securitytoken)*› | null*

*Defined in* [*src/types/index.ts:779*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/types/index.ts#L779)

Security Tokens over which this key has permissions

***

### transactionGroups

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

*Defined in* [*src/types/index.ts:791*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/types/index.ts#L791)

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/v11/docs/interfaces/transactionpermissions.md) *| null*

*Defined in* [*src/types/index.ts:783*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/types/index.ts#L783)

Transactions this key can execute

## Methods

### createGroup

▸ **createGroup**(`args`: [CreateGroupParams](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/creategroupparams.md), `opts?`: [ProcedureOpts](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/procedureopts.md)): *Promise‹*[*TransactionQueue*](https://developers.polymath.network/polymesh-sdk-api-reference/v11.0.2/classes/transactionqueue)*‹*[*CustomPermissionGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/v11.0.2/classes/custompermissiongroup)*››*

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:63*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/api/entities/SecurityToken/Permissions.ts#L63)

Create a Permission group for this Security Token. Identities can then be assigned to said group as Agents. Agents assigned to a group have said group's permissions over this Security Token

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/proceduremethod.md), which means you can call `createGroup.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

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

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

***

### getAgents

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:163*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/api/entities/SecurityToken/Permissions.ts#L163)

Retrieve a list of Agents (Identities which have permissions over the Security Token) and their respective Permission Groups

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

***

### getGroup

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:93*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/api/entities/SecurityToken/Permissions.ts#L93)

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/v11.0.2/classes/custompermissiongroup)*›*

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:94*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/api/entities/SecurityToken/Permissions.ts#L94)

**Parameters:**

▪ **args**: *object*

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

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

***

### getGroups

▸ **getGroups**(): *Promise‹object›*

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:126*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/api/entities/SecurityToken/Permissions.ts#L126)

Retrieve all Permission Groups of this Security Token

**Returns:** *Promise‹object›*

***

### inviteAgent

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:73*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/api/entities/SecurityToken/Permissions.ts#L73)

Invite an Identity to be an Agent with permissions over this Security Token

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/proceduremethod.md), which means you can call `inviteAgent.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

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

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

***

### removeAgent

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:83*](https://github.com/PolymathNetwork/polymesh-sdk/blob/da0f7fd7/src/api/entities/SecurityToken/Permissions.ts#L83)

Revoke an Agent's permissions for this Security Token

**`note`** this method is of type [ProcedureMethod](https://github.com/PolymathNetwork/polymesh-sdk/blob/docs/v11/docs/interfaces/proceduremethod.md), which means you can call `removeAgent.checkAuthorization` on it to see whether the Current Account has the required permissions to run it

**Parameters:**

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

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