Skip to content

Exclusions as roles: NoLogin, DoNotContact, hidden shift types/positions (#848) - #893

Merged
mbhewitt merged 2 commits into
mainfrom
feat/exclusions
Nov 29, 2026
Merged

mbhewitt merged 2 commits into
mainfrom
feat/exclusions

Conversation

@mbhewitt

Copy link
Copy Markdown
Owner

Roadmap item 13. Refs #848. Built to Mew's 2026-11-29 answers: exclusions are plain roles, not a new table ("handled with roles to avoid creating another thing"). Only admins see someone's roles.

Migration 031

  • Adds four roles: NoLogin (2000040), NoCamping (2000041), NoTicketHelp (2000042), DoNotContact (2000043). Admins assign them like any other role.
  • Adds hidden_role_id to op_shift_name and op_position_type. Anyone holding that role doesn't see the shift type or position. It's the reverse of op_position_type.role_id.

Enforcement

  • NoLogin:
    • Okta and passcode sign-in refuse the person ("please contact Census").
    • A live session gets a 401 on its next request, which signs the client out. The check is in readSessionFromRequest, so every authed API call is covered. The dust hop checks separately.
  • Hidden shift types and positions:
    • They're removed from that person's shift list, the shift detail page (404 when nothing is left), and shift eligibility.
    • checkShiftAdd gets a new excluded hard blocker. Admins can't override it; the fix is to lift the role.
    • Signups made before the exclusion stay. Admins see "(excluded)" on those rows in the roster (Mew: flagged, not removed).
  • DoNotContact:
    • enqueueEmail drops the person from to/cc on every email, whether the sender gave their account or only their address. Before this, the unsubscribe check only ran when the sender passed recipientShiftboardId. Unsubscribe behavior itself is unchanged.
    • The prod mailing-list sync and the thank-you-card list skip these people too. Those are edited outside this repo.
  • NoCamping / NoTicketHelp: the roles exist now and are enforced when the camping and ticketing forms are built (Camping with Census: invitation list and decision screen (Census Lab / Counter Culture / reject) #845, Ticketing: decision screen (staff / gift / discount / full price) #846).
  • People who have never logged in: create their account on the existing Create Account page, then add the role. A later Okta login matches on email and lands on that account.

UI

  • Shift type and position forms get a "Hidden from role" picker.

Tests

  • New e2e/tests/38-exclusions.spec.ts covers the hidden position (list, detail, self-add and admin-add blocked, roster flag), DoNotContact (no email queued), and NoLogin (a live session gets 401).
  • Locally, 38 plus specs 02, 03, 11, 12 and 28 (19 tests) pass.

🤖 Generated with Claude Code

mbhewitt and others added 2 commits November 29, 2026 00:44
Mew 2026-11-29: exclusions are plain roles, no new table.
- migration 031: NoLogin, NoCamping, NoTicketHelp, DoNotContact roles;
  hidden_role_id on op_shift_name and op_position_type
- NoLogin: refused at Okta + passcode sign-in; a live session gets 401 on
  its next request (readSessionFromRequest), dust hop too
- hidden_role_id: whoever holds the role doesn't see the shift type /
  position (list, detail, eligibility) and can't be added (hard blocker,
  admins included); earlier signups show (excluded) to admins
- DoNotContact: the mail queue drops them from every email, by account or
  address, not only callers that pass recipientShiftboardId
- "Hidden from role" on the shift type and position forms

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mbhewitt
mbhewitt merged commit 683d642 into main Nov 29, 2026
1 check passed
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