1.2.1 Assign role
Assign role Step-by-Step test guide
Assigns a role to a user. The caller must be a signed account that is already registered in AdminAccounts. The function checks the role is not already assigned, inserts the (user, role) entry into AccountRoles storage, emits RoleAssigned { user, role }, and returns Ok(()).
Developer → Extrinsics.

Account: select an admin account.
Extrinsic: choose
xcavateWhitelist.Call:
assign_role.

Parameters:
user: account to assign role to (e.g.,Charlie)role: select role enum (e.g.,RegionalOperator).

Submit transaction.

Sign and submit.

Transaction approved with green tick on the top right hand corner.

✅ Check result:
Developer → (1) Chain State → (2)
xcavateWhitelist → accountRoles→ (3) accountId32 (Charlie) → (4) Click + QueryShould return (5)
RegionalOperator - Compliant.

Last updated