Skip to main content
Version: 27.0.x

Class: AssetPermissions

api/entities/Identity/AssetPermissions.AssetPermissions

Handles all Asset Permissions (External Agents) related functionality on the Identity side

Hierarchy

  • Namespace<Identity>

    AssetPermissions

Methods

checkPermissions

checkPermissions(args): Promise<CheckPermissionsResult<Identity>>

Check whether this Identity has specific transaction Permissions over an Asset

Parameters

NameType
argsObject
args.assetstring | BaseAsset
args.transactionsnull | TxTag[]

Returns

Promise<CheckPermissionsResult<Identity>>

Defined in

api/entities/Identity/AssetPermissions.ts:133


enabledAt

enabledAt(«destructured»): Promise<null | EventIdentifier>

Retrieve the identifier data (block number, date and event index) of the event that was emitted when this Identity was enabled/added as an Agent with permissions over a specific Asset

Parameters

NameType
«destructured»Object
› assetstring | Asset

Returns

Promise<null | EventIdentifier>

Note

uses the middlewareV2

Note

there is a possibility that the data is not ready by the time it is requested. In that case, null is returned

Defined in

api/entities/Identity/AssetPermissions.ts:324


get

get(): Promise<AssetWithGroup[]>

Retrieve all the Assets over which this Identity has permissions, with the corresponding Permission Group

Returns

Promise<AssetWithGroup[]>

Defined in

api/entities/Identity/AssetPermissions.ts:104


getGroup

getGroup(«destructured»): Promise<CustomPermissionGroup | KnownPermissionGroup>

Retrieve this Identity's Permission Group for a specific Asset

Parameters

NameType
«destructured»Object
› assetstring | BaseAsset

Returns

Promise<CustomPermissionGroup | KnownPermissionGroup>

Defined in

api/entities/Identity/AssetPermissions.ts:283


getOperationHistory

getOperationHistory(opts): Promise<ResultSet<EventIdentifier>>

Retrieve all Events triggered by Operations this Identity has performed on a specific Asset

Parameters

NameTypeDescription
optsObject-
opts.assetstring | FungibleAsset-
opts.eventId?EventIdEnumfilters results by event
opts.moduleId?ModuleIdEnumfilters results by module
opts.size?BigNumberpage size
opts.start?BigNumberpage offset

Returns

Promise<ResultSet<EventIdentifier>>

Note

uses the middlewareV2

Note

supports pagination

Defined in

api/entities/Identity/AssetPermissions.ts:375


setGroup

setGroup(args, opts?): Promise<GenericPolymeshTransaction<CustomPermissionGroup | KnownPermissionGroup, CustomPermissionGroup | KnownPermissionGroup>>

Assign this Identity to a different Permission Group for a given Asset

Parameters

NameType
argsSetPermissionGroupParams
opts?ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<CustomPermissionGroup | KnownPermissionGroup, CustomPermissionGroup | KnownPermissionGroup>>

Note

this method is of type ProcedureMethod, which means you can call setGroup.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Defined in

api/entities/Identity/AssetPermissions.ts:360


waive

waive(args, opts?): Promise<GenericPolymeshTransaction<void, void>>

Abdicate from the current Permissions Group for a given Asset. This means that this Identity will no longer have any permissions over said Asset

Parameters

NameType
argsWaivePermissionsParams
opts?ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>

Note

this method is of type ProcedureMethod, which means you can call waive.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

Defined in

api/entities/Identity/AssetPermissions.ts:350