Skip to content

revoke_role only clears the legacy single-role slot — multi-role addresses can't be individually revoked #782

Description

@dinahmaccodes

Tier: Hard
Description: An address can hold multiple roles (e.g. Company then later Guardian) since set_role maintains both a per-role flag map and a single legacy Role(addr) pointer. storage::revoke_role unconditionally resets the legacy pointer, and the public revoke_role only operates on storage::get_role() — never iterating actual per-role flags. There's no way to revoke a non-primary role, and revoking "the" role can leave stale UserRole flags true while get_role reports Unassigned.
Files: contracts/shipment/src/storage.rs:386-393, contracts/shipment/src/lib.rs:1937-1958
Tasks:

  • Extend revoke_role to accept and clear a specific role from the per-role flag map, not just the legacy slot
    Acceptance Criteria:
  • Any individual role held by a multi-role address can be revoked without desyncing get_role

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions