# 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/docs-v10/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/docs-v10/classes/context)

*Inherited from void*

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

### `Protected` parent

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

*Inherited from void*

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

### portfolios

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

*Defined in* [*src/types/index.ts:809*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/types/index.ts#L809)

### tokens

• **tokens**: [*SectionPermissions*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/sectionpermissions)*‹*[*SecurityToken*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/classes/securitytoken)*› | null*

*Defined in* [*src/types/index.ts:795*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/types/index.ts#L795)

Security Tokens over which this key has permissions

### transactionGroups

• **transactionGroups**: [*TxGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/enums/txgroup)*\[]*

*Defined in* [*src/types/index.ts:807*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/types/index.ts#L807)

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://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/transactionpermissions) *| null*

*Defined in* [*src/types/index.ts:799*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/src/types/index.ts#L799)

Transactions this key can execute

## Methods

### createGroup

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:63*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/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://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/proceduremethod), 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://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/creategroupparams) |
| `opts?` | [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/procedureopts)         |

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

### getAgents

▸ **getAgents**(): *Promise‹*[*AgentWithGroup*](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/agentwithgroup)*\[]›*

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:163*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/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://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/agentwithgroup)*\[]›*

### getGroup

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:93*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/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/docs-v10/classes/custompermissiongroup)*›*

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

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

**Parameters:**

▪ **args**: *object*

| Name   | Type                                                                                                                     |
| ------ | ------------------------------------------------------------------------------------------------------------------------ |
| `type` | [PermissionGroupType](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/enums/permissiongrouptype) |

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

### getGroups

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

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

Retrieve all Permission Groups of this Security Token

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

### inviteAgent

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:73*](https://github.com/PolymathNetwork/polymesh-sdk/blob/959efb76/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://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/proceduremethod), 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://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/inviteexternalagentparams) |
| `opts?` | [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/procedureopts)                         |

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

### removeAgent

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

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

Revoke an Agent's permissions for this Security Token

**`note`** this method is of type [ProcedureMethod](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/proceduremethod), 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://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/removeexternalagentparams) |
| `opts?` | [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v10/interfaces/procedureopts)                         |

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