# 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-v8/classes/securitytoken)›

  ↳ **Permissions**

## Index

### Properties

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

### Methods

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

## Properties

### `Protected` context

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

*Inherited from void*

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

### `Protected` parent

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

*Inherited from void*

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

### portfolios

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

*Defined in* [*src/types/index.ts:727*](https://github.com/PolymathNetwork/polymesh-sdk/blob/7362b318/src/types/index.ts#L727)

### tokens

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

*Defined in* [*src/types/index.ts:713*](https://github.com/PolymathNetwork/polymesh-sdk/blob/7362b318/src/types/index.ts#L713)

Security Tokens over which this key has permissions

### transactionGroups

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

*Defined in* [*src/types/index.ts:725*](https://github.com/PolymathNetwork/polymesh-sdk/blob/7362b318/src/types/index.ts#L725)

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-v8/interfaces/transactionpermissions) *| null*

*Defined in* [*src/types/index.ts:717*](https://github.com/PolymathNetwork/polymesh-sdk/blob/7362b318/src/types/index.ts#L717)

Transactions this key can execute

## Methods

### createGroup

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:60*](https://github.com/PolymathNetwork/polymesh-sdk/blob/7362b318/src/api/entities/SecurityToken/Permissions.ts#L60)

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-v8/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-v8/interfaces/creategroupparams) |
| `opts?` | [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v8/interfaces/procedureopts)         |

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

### getAgents

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:123*](https://github.com/PolymathNetwork/polymesh-sdk/blob/7362b318/src/api/entities/SecurityToken/Permissions.ts#L123)

Retrieve a list of external agents of the Security Token

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

### getGroups

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:87*](https://github.com/PolymathNetwork/polymesh-sdk/blob/7362b318/src/api/entities/SecurityToken/Permissions.ts#L87)

Retrieve all group permissions of the Security Token

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

### inviteAgent

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

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

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-v8/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-v8/interfaces/inviteexternalagentparams) |
| `opts?` | [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v8/interfaces/procedureopts)                         |

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

### removeAgent

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

*Defined in* [*src/api/entities/SecurityToken/Permissions.ts:80*](https://github.com/PolymathNetwork/polymesh-sdk/blob/7362b318/src/api/entities/SecurityToken/Permissions.ts#L80)

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-v8/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-v8/interfaces/removeexternalagentparams) |
| `opts?` | [ProcedureOpts](https://developers.polymath.network/polymesh-sdk-api-reference/docs-v8/interfaces/procedureopts)                         |

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