1.2.3 (Option) Set Permission

Set Permission Step-by-Step test guide

Sets/updates an AccessPermission for a given (user, role). The caller must be a signed account that is registered in AdminAccounts. The function reads the current permission (failing if the role is not assigned), ensures the new permission differs from the current one, writes the updated permission into AccountRoles storage, emits PermissionUpdated { user, role, permission }, and returns Ok(()).

  1. Developer → Extrinsics.

  1. Account: admin.

  2. Extrinsic: choose xcavateWhitelist → Call: set_permission.

  1. Parameters:

    1. user: account with the role.

    2. role: the role to update.

    3. permission: select Compliant or Revoked.

  2. Submit Transaction

  1. Sign and Submit

  1. Approved at second attempt

✅ Check result:

  • Developer → (1) Chain State → (2) xcavateWhitelist → accountRoles → (3) accountId32 (Bob) → (4) Click + Query

  • Should match permission.

Last updated