Class: Permissions
api/entities/Asset/Permissions.Permissions
Handles all Asset Permissions related functionality
Hierarchy
-
Namespace
<Asset
>↳
Permissions
Methods
createGroup
▸ createGroup(args
, opts?
): Promise
<GenericPolymeshTransaction
<CustomPermissionGroup
, CustomPermissionGroup
>>
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
Parameters
Name | Type |
---|---|
args | CreateGroupParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<CustomPermissionGroup
, CustomPermissionGroup
>>
Note
this method is of type ProcedureMethod, which means you can call createGroup.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/entities/Asset/Permissions.ts:69
getAgents
▸ getAgents(): Promise
<AgentWithGroup
[]>
Retrieve a list of agents (Identities which have permissions over the Asset) and their respective Permission Groups
Returns
Promise
<AgentWithGroup
[]>
Defined in
api/entities/Asset/Permissions.ts:170
getGroup
▸ getGroup(args
): Promise
<CustomPermissionGroup
>
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
Parameters
Name | Type |
---|---|
args | Object |
args.id | BigNumber |
Returns
Promise
<CustomPermissionGroup
>
Throws
if there is no Permission Group with the passed ID
Defined in
api/entities/Asset/Permissions.ts:103
▸ getGroup(args
): Promise
<KnownPermissionGroup
>
Parameters
Name | Type |
---|---|
args | Object |
args.type | PermissionGroupType |
Returns
Promise
<KnownPermissionGroup
>
Defined in
api/entities/Asset/Permissions.ts:104
getGroups
▸ getGroups(): Promise
<PermissionGroups
>
Retrieve all Permission Groups of this Asset
Returns
Promise
<PermissionGroups
>