Skip to content

Hide role assignments from viewers who can't see the org's roles - #36

Merged
amyjko merged 1 commit into
mainfrom
hide-arci-for-non-members
Nov 7, 2026
Merged

amyjko merged 1 commit into
mainfrom
hide-arci-for-non-members

Conversation

@amyjko

@amyjko amyjko commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Problem

After #35 deployed, logged-out visitors to /org/uwischool/process/TeachingEvaluations see red "Unknown role" badges in every step's ARCI chart and on the "… is accountable" line.

The roles RLS policy only returns roles to members, or to anyone if the org is public. Everyone else gets an empty role list, so RoleLink shows its "Unknown role" badge for every assignment.

Change

Show role assignments only when member || org.visibility === 'public', which is the same rule as the RLS policy.

  • ARCI.svelte: render nothing when the viewer can't see roles. This covers both the top step's chart and each sub-step's chart.
  • Process page: hide the whole "Who" section (heading, accountable line, chart) under the same rule.

(The roles, processes and changes list pages use a narrower check that also hides public-org roles from logged-in non-members. That inconsistency is untouched here.)

Testing

On the local stack, I loaded a public step with accountable, responsible, consulted and informed roles:

Viewer Private org, main Private org, this change Public org, this change
Logged out 4 "Unknown role" badges no Who section, no badges role links
Logged in, not a member 4 "Unknown role" badges no Who section, no badges role links
Member role links role links (unchanged) role links (unchanged)

No console warnings or errors for any viewer. svelte-check: 0 errors. Unit tests: 288 passed.

🤖 Generated with Claude Code

Roles are only readable by members, or by anyone if the org is public.
Everyone else got an empty role list, so each ARCI chart and the
accountable line rendered as red "Unknown role" badges. Hide them under
the same rule as the RLS policy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@amyjko
amyjko merged commit 5477b31 into main Nov 7, 2026
1 check passed
@amyjko
amyjko deleted the hide-arci-for-non-members branch November 7, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant