Open
Labels
needs: MewWaiting on a decision/review from Mew (triage 2026-10-30)
Description
Requested by Mew 2026-09-05. Two concrete shift-page features + a broader roles/permissions rethink. Grouped because the shift controls depend on the permission model.
Part A — Shift-page admin controls (concrete, shippable)
- Add Cancel / Edit / Reschedule buttons on each shift's page.
- Initially gated to super admins (see Part C for the eventual model).
- "Cancel" already exists as a data path (canceled shifts fire notification emails, e.g. Art Tour 2026-09-03) — this exposes it in the UI. "Reschedule" = change start/end time; "Edit" = other shift fields.
- Cancel/reschedule should reuse the existing shift-canceled / (and a new shift-rescheduled?) volunteer notification flow.
Part B — Show canceled shifts in the list (strikethrough)
- Canceled shifts are currently hidden from the shift list. Instead, show them with strikethrough so it's clear a shift existed and was canceled (avoids "did it ever exist?" confusion).
- Applies to the agenda (
Schedule.tsx) and any admin shift lists.
Part C — Roles & permissions redesign (design-heavy; post-event)
Rethink the tiers and what each can access. Mew's initial direction:
- Leads — a more limited set than today.
- Coordinator — NEW role: more access than Leads, less than Leadership.
- Leadership — replaces today's Admin.
- (TBD top tier) — replaces today's Super Admin (name TBD).
Proposed starting matrix (for discussion — not final):
| Capability | Lead | Coordinator | Leadership | Top (TBD) |
|---|---|---|---|---|
| Check volunteers in/out, review | ✅ | ✅ | ✅ | ✅ |
| Add/remove volunteers on own shift | ✅ | ✅ | ✅ | ✅ |
| Cancel/edit/reschedule shifts | ✕ | limited? | ✅ | ✅ |
| Manage shift types/positions/categories | ✕ | ✕ | ✅ | ✅ |
| Role grants / user management | ✕ | ✕ | limited | ✅ |
| QR codes / reports / data export | ✕ | ✅? | ✅ | ✅ |
| System/config, provisioning | ✕ | ✕ | ✕ | ✅ |
Notes / scope
- This is a migration: renaming roles touches
op_rolesnames, every authz check (checkIsAdmin/checkIsSuperAdmin→ new predicates), UI gating (pageList, footer sections, per-page guards), and the seed/reference data. Needs a design pass + a mapping of old→new roles before any code. - Keep backward-compat during transition (map existing Admin→Leadership, SuperAdmin→Top) so no one loses access mid-migration.
- Not a mid-event change. Part A/B could ship sooner; Part C is a deliberate post-event redesign.
Related: #719 (restrict who can sign up for certain shift types), #730 (audit logging — pairs with permission changes).
Metadata
Metadata
Assignees
Labels
needs: MewWaiting on a decision/review from Mew (triage 2026-10-30)
Activity
mbhewitt commentedon Sep 5, 2026
Part A — Reschedule: notification + penalty rules (Mew 2026-09-05)
When a shift is rescheduled, in addition to changing the time:
op_email_queue.ics_attachment/ics_filename, same path the newsletter/QR calendar flow uses.)Implementation notes:
rescheduled_at/penalty_exempt) that the no-show finalizer and any drop-penalty check honor.shift-rescheduledcategory.mbhewitt commentedon Sep 10, 2026
Role-based security design session (2026-09-10) — the "op_roles is a junk drawer" analysis
Pulled the live
op_rolestable (~50 rows). It conflates 6 distinct concepts all stored as "roles," which is why authz feels confusing — you can't cleanly ask "who can do X":Recommended model (separate the concepts):
can_approve_purchase,can_edit_shift,can_view_notes) — what the app actually checks.Server-side enforcement (the key security fix): today some gating is client-side (
checkIsSuperAdmin(accountType, roleList)in React) — that hides UI but does not stop a determined user. Real enforcement must be 100% server-side: every mutating endpoint callscan(session, permission)before acting; client checks stay only to hide UI, never as the lock. (lib/authz.tsalready does object-levelisAdmin/isSuperAdmin/isOwnerOrAdmin— extend that into a general permission layer.)Safe rollout (not a live prod experiment):
can()fn backed by a role→permission map defined in code. No schema churn, zero data risk.Priority (Chipper, 2026-09-10): this is the #1 change and should be built FIRST because every other feature touches it; explicitly NOT to be hot-swapped in production while people are actively using it.
mbhewitt commentedon Sep 10, 2026
🔐 Designating this as the canonical Role-Based Security epic (Chipper priority #1, 2026-09-10)
Role/permission work is currently fragmented across 7 issues. Consolidating under #731 as the single epic we build first. Sub-issues:
account_type)Build order (Chipper): role-based security FIRST, then audit logging (#730) rides on top of the permission layer. Design + the "op_roles is a junk drawer of 6 concepts" analysis is in the comment above. Not to be hot-swapped in live production.
mbhewitt commentedon Sep 10, 2026
Requirement: form/feature-level gating + DYNAMIC (capacity/interest-based) visibility (Chipper 2026-09-10)
Role-based security must gate not just API actions but which forms/features a user can even see. Real examples:
hasRole().Design implication: the
can(session, permission, context)layer should accept context (capacity remaining, admin on/off switch), and the front-end should hide/show forms based on the same server-evaluated gate (never client-only). This generalizes the existing per-form audience needs.mbhewitt commentedon Sep 10, 2026
Refinement (Chipper 2026-09-10): a form's audience should map to a configurable SET of roles (admin-editable), not a hardcoded single role. So the gate is: form → {allowed role set} + optional dynamic conditions (capacity, admin toggle). Any form can be pointed at any combination of roles without code changes.
mbhewitt commentedon Sep 10, 2026
🧩 DRAFT: Permission model + role→permission map (Claude, 2026-09-10) — for Chipper's review
Grounded in the 73 real API endpoints. Two-layer model: permissions (fine-grained actions the server checks) bundled into roles. Attestations/training/camp membership are pulled OUT of "roles proper."
A. Permission catalog (resource : action) — derived from the API
volunteer:read_ownvolunteer:read_anyvolunteer:edit_ownvolunteer:edit_anyvolunteer:listshift:signup_selfshift:remove_selfshift:add_othershift:remove_othershift:checkinshift:cancelshift:add_noteshift_type:manageshift_position:manageshift_category:manageshift_time:managedates:managesap:readsap:assignsap:manage(upload/issue/offbook/notes/email)role:readrole:grant_revokerole:manage_definitionsrole:manage_displaynote:read_shiftnote:add_shiftnote:read_volunteerqr:createqr:managedevice:provisionsystem:read_only_togglesettings:managereport:viewform:project_submitform:item_submitform:ranch_signupform:data_requestcontact:submitB. Roles (collapsed to authority-bearing) → permissions
contact:submit,form:data_requestshift:checkinshift:add_notenote:read_shift, read roster + BS status of their shiftvolunteer:read_any/edit_any/list, all shift config,dates:manage,sap:read/assign,shift:cancel,report:viewrole:grant_revoke/manage_definitions/manage_display,sap:manage,settings:manage,qr:manage,system:read_only_toggleC. Membership roles (NOT authority — they gate form audiences only)
Core Crew,Camped-with-us(CensusLabCamp/CounterCultureCamp),Previous Ranch Crew→ grantform:project_submit/form:item_submit/form:ranch_signupper the configurable role-set map (#731 gating comment). Dynamic conditions (capacity/admin-toggle) layer on top.D. Pulled OUT of roles (become flags/records, not permissions)
Open for Chipper
budget:approverole? (private module)form:data_requesttruly be public, or authed-volunteer only?mbhewitt commentedon Sep 10, 2026
✏️ CORRECTION (Chipper 2026-09-10): NO "SuperAdmin" — single Admin role = everything
Chipper: "SuperAdmin isn't actually a thing, I hate it." Collapse the two top tiers into one:
Adminhas ~30 holders andSuperAdmin~9; the merged Admin should be trimmed to the ~9-person core group, not 30.Revised role ladder: Public → Volunteer → Shift Lead → Department Lead → Admin (everything, select core group). Drop the SuperAdmin row from the table above; merge its permissions into Admin. Question #2 (who approves purchases) is answered: Admin.
mbhewitt commentedon Sep 10, 2026
✏️ Refinement (Chipper 2026-09-10): use EXISTING roles; push the operational slice of today's "Admin" down to Shift Lead
Two points:
op_roles). This work is about tying functionality to the roles we already have, not creating a new vocabulary.Which of today's Admin-gated abilities move to Shift Lead (the stuff a lead actually needs on-playa):
shift:checkin— check volunteers in/out (their shift)shift:add_other/shift:remove_other— add/remove volunteers on their shiftnote:read_shift/note:add_shift— read + add shift/volunteer notesWhat stays Admin-only (the trimmed core group): role grant/revoke + role definitions, SAP management, shift-type/position/category/date config, settings, QR management, read-only toggle, budget approvals.
Net: the same people who are shift leads gain the operational admin abilities via the Shift Lead role — no full-Admin needed, no new roles. Admin shrinks to the sensitive/config/authority powers for the core group.
mbhewitt commentedon Sep 10, 2026
Shift Lead — specific configurable abilities + scoping (Chipper 2026-09-10)
Chipper's explicit list of abilities to make configurable on the Shift Lead role:
volunteer:read, scoped to people on shifts they lead — not necessarily the global list).note:add_volunteer(new distinct permission).note:add_shift.Scoping is the key nuance: a Lead's abilities are scoped to their shift / shift-types, not global. So
can(session, permission, context)must check shift/shift-type ownership:note:readscope = the lead's own shift-types; global note-history stays Admin.Updated permission list gains:
note:add_volunteer(distinct fromnote:add_shift), and every Lead permission carries a scope = own-shifts/own-shift-types qualifier. Admin = unscoped (all).mbhewitt commentedon Sep 10, 2026
Add a VC (Volunteer Coordinator) level for notes (Chipper 2026-09-10)
There should be a VC-level note-access tier — an intermediate scope between Shift Lead and Admin:
So notes gain a 3-tier read scope: own-shift (Lead) → coordination-area (VC) → all (Admin). VC is an existing coordination responsibility; tie note visibility to it rather than forcing VCs to be Admins.
(Assumption: "VC" = Volunteer Coordinator — Chipper to confirm the exact scope boundary for a VC vs a Dept Lead.)
mbhewitt commentedon Sep 10, 2026
VC (Volunteer Coordinator) = possibly a NEW role; broad volunteer READ + "Management" same bucket (Chipper 2026-09-10)
Refinement — VC is broader than "coordination-area" scope:
Volunteer Coordinatorrole if it doesn't exist.Updated notes/read scope ladder:
So VC/Management is a read-broad tier: sees all, changes little. Distinct from Admin (the small core group that can do everything).
mbhewitt commentedon Sep 10, 2026
🎛️ Centerpiece UX: a front-end role × feature configuration matrix (Chipper 2026-09-10)
The whole system should be data-driven and admin-editable — not hardcoded. Chipper's expectation:
So the deliverable is a permission-matrix admin page:
role_permissionstable (role_id × permission_key); the server-sidecan()reads it; the UI hides/shows features from the same source.Where "Authenticated Users" fit: the base Authenticated Volunteer is just another column/role in the matrix — the default baseline every logged-in user has. Whatever's toggled on for that base role = what a plain authenticated volunteer can do. No special-casing; it's configured exactly like the others.
This makes the matrix the single source of truth: roles already exist, features are enumerated, and the grid ties them together — editable, server-enforced. (Extends #588 role-roster admin UI, #500 roles-admin clarity.)
mbhewitt commentedon Sep 10, 2026
Role assignment unchanged; role definition happens on the new setup page (Chipper 2026-09-10)
So the flow is: create role → set its capabilities on the setup page → then assign it to people the same way as now. The setup page owns role definition + capability config; assignment stays put.
mbhewitt commentedon Sep 10, 2026
Role setup page also configures HOW a role is acquired (auto-grant rules) (Chipper 2026-09-10)
The role setup page should expose a third facet beyond capabilities + assignment: how a person gets the role in the first place — configurable on the front-end.
Many roles are auto-granted by system events today (hardcoded):
Census Random Samplerrole.training/confirmation/[code]handler writesop_volunteer_roles).Previous Ranch Crew(proposed).Chipper wants that trigger→role mapping to be configurable on the same role setup page, not baked in code.
So the role setup page owns 3 things per role:
Makes the training/event → role wiring data-driven instead of hardcoded per-training. (Ties to #426 roles-on-join, #253 training-completed endpoint, and the training→role_id linkage in
training/confirmation.)mbhewitt commentedon Sep 10, 2026
Setup is a uniform boolean toggle grid; includes override perms; page is Admin-only (Chipper 2026-09-10)
override:*(override system guardrails)override:overlap(double-booking), and likely siblings (override:eligibility,override:capacity,override:read_only) — each a per-role boolean. These let a role bypass a normally-enforced check.Permission catalog gains an "Overrides" section; the setup page is the Admin-only home for capabilities + acquisition rules + (uniform) toggles.
12 remaining items
mbhewitt commentedon Oct 17, 2026
"Self" is its own scope (Chipper, 2026-10-17)
Every toggle is set per scope, and self is one of the scopes. Proposed scopes:
So a role's grid is page/ability × scope, still within when/where. Shift Lead examples:
Rule for people with several roles: take the best grant they have that fits this subject. Self and peer exclusions always apply, whatever the role. (Admin seeing their own review is still TBD.)
🤖 Generated with Claude Code
mbhewitt commentedon Oct 17, 2026
Scope also includes the subject's role (Chipper, 2026-10-17)
Scope has two parts:
"Peer leads" isn't a separate scope after all. It's on my shift + holds a Lead role.
Examples:
Grid per role: page/ability × scope (relationship + subject role) × when × where. Defaults still reproduce today's behaviour.
🤖 Generated with Claude Code
mbhewitt commentedon Oct 17, 2026
Step 1: which roles are permission-setting roles? (Chipper, 2026-10-17)
All 50
op_rolesrows on prod, sorted by what they actually are. Holder counts are live; "gates" = how many positions require that role to sign up.A. Permission-setting roles — configured in the new module (proposed)
B. Qualification roles — only gate shift sign-up (keep on the position settings, not the module)
Census Random Sampler (34, gates 1) · Census Random Sampler - Veteran (1) · Census Driver (6, gates 1) · DataBeast Technician (3, gates 1) · Data Entry (18) · Data Entry - Veteran (0) · Setup/Strike (17) · Census Lab Host - Veteran (0) · BxB Sampler (0) · Blog Writer (0) · Data Visualization (0) · Special Project (1) · Training (0)
C. Attestations / flags — become volunteer flags, not roles
Signed Behavioral Standards (167) · BurnerProfileUpdated (143) · Data Analysis - Release Signed (4) · WAP_V_override (5) · EmailUnsubscribed (6) · CensusTicket (6) · OtherSAP (37) · Not This Year (0) · Passed online RS-test-out (0) · emergencyContact (0) · campingLocation (0) · NewWAPstartdate (0)
D. Training completions — become training records (can auto-grant roles)
TrainingWelcomeComplete (148) · TrainingCensusBasicsComplete (125) · TrainingRandomSamplingComplete (83) · TrainingOutReachComplete (34) · TrainingDataEntryWizComplete (29) · TrainingDataBeastDriverComplete (9)
E. Camp / team membership — form audiences and position gates, not authority
Staff (17) · CensusLabCamp (17, gates 1) · CounterCultureCamp (13) · Camping With Census (9)
F. Account type (#614) — becomes
account_typeTestAccount (4) · OrgAccount (1)
Questions
🤖 Generated with Claude Code
mbhewitt commentedon Oct 17, 2026
Per-area lead roles, auto-granted on sign-up, rolled up into a Shift Lead group (Chipper, 2026-10-17)
To settle
🤖 Generated with Claude Code
mbhewitt commentedon Oct 17, 2026
Correction (Chipper, 2026-10-17): "shift lead should still work exactly like it works today."
mbhewitt commentedon Oct 17, 2026
Shift sign-up is a permission too (Chipper, 2026-10-17)
role_id. Per position (or shift type), three choices:role_idgate, extended to a set of roles🤖 Generated with Claude Code
mbhewitt commentedon Oct 17, 2026
Permission-granting roles, draft v2 (2026-10-17, after Chipper's corrections)
Not permission roles but used as scope/sign-up filters: qualifications (Random Sampler, Driver, DataBeast Tech, Data Entry, Setup/Strike, Veterans…). Flags, training completions, camp/team and account type move out of roles eventually.
Open:
🤖 Generated with Claude Code
mbhewitt commentedon Oct 17, 2026
Permission catalog, draft v1 (2026-10-17)
Built from the app's real pages and API routes. V/A/U/D = view / add / update / delete. Each permission is granted per role, with a scope (relationship: self / my shift / my department / everyone + subject role or position filter), a when (event + shift windows), and a where (on/off-playa). Default = today's behaviour.
1. Shifts & sign-up
/shifts/shifts/[id]/volunteers2. Shift setup (Admin by default, grantable)
/shifts/types/shifts/positions/shifts/categories/dates3. Volunteers
/volunteers/volunteers/[id]/info(self vs. others; PII could be its own level)/volunteers/[id]/account/volunteers/[id]/schedule/volunteers/account/create/roles/behavioral-standards/[id]4. Roles & permissions (Admin by default)
/roles/roles/[id]/volunteers(scope: which roles you may grant)5. SAPs
/saps/saps6. Ops & system
/qr-codes/reports/printing/census-survey-reminders/provision,/provision-tablet/settings/settings7. Overrides (bypass a built-in check)
Double-booking · capacity (shift full) · eligibility (missing role) · outside check-in window · read-only mode
8. Public / baseline
Contact form: A · Training pages: V + complete own · Home page: V
Open
🤖 Generated with Claude Code
mbhewitt commentedon Oct 17, 2026
Decisions (Chipper, 2026-10-17)
What this means for the design: "permission role vs not" is not a code or schema distinction. The setup page lists all roles, and a role with no grants simply has the baseline. The v2 role list above is only the starting seed: which roles get non-empty grids on day one so the app behaves as it does today. The purpose/type field (#472) is a label to help organise the list, not a gate.
🤖 Generated with Claude Code
mbhewitt commentedon Oct 17, 2026
Design for review: #804 (consolidates everything in this thread, plus Chipper's 2026-10-17 answers on the role list).
mbhewitt commentedon Nov 27, 2026
From Mew's 2026-11-26 roadmap (item 5):
This is Part A of this ticket, and Mew wants it in addition to the Shift Types editor, not instead of it. Related: #227 (cancel button), #804 (permissions), #596 B, #432/#466/#533 (bugs in the existing edit path), #730/#620 (log the edits), #843 (on-playa edits).
Notes from the code
withWriteGuard(shiftTypeUpdate, "superadmin"): only super admins today.pages/api/shifts/types/[typeId]/times/[timeId]/only haspositions/index.ts), so one is needed; both edit paths should share validation.ShiftVolunteers.tsxalready knows the canceled state.Conflicts to resolve
Questions for Mew
Tracking: #849
mbhewitt commentedon Nov 27, 2026
Mew (2026-11-27, #851 conflict 7): needs more discussion. Open question: does a new Leadership role replace today's Admin (#731 Part C), or does SuperAdmin become App Admin with Admin unchanged on day one (#804)? Don't build either part until this is settled.
mbhewitt commentedon Nov 29, 2026
Roadmap item 5 (#849) started 2026-11-29. Mew: "If the user can edit shifts be able to do it from the shift page in addition to going through the standard process."
Questions posted in #census (my default in brackets):
mbhewitt commentedon Nov 29, 2026
Shipped in PR #901 (prod 2027.G.00901.C, 2026-11-29). Migration 037 applied. Leaving this open for Mew to close.