Permissions Phase 1: capability matrix + admin editor + page gates (behavior-neutral)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- authorization, database, full-stack, internationalization
Research direction
Start by reading types/permissions.ts, middleware/01.permission.global.ts, and the current computePermissions/pageAccessMap behavior before mapping the database model and admin page at /roles or /permissions. Done means seeded access is unchanged, editable role capabilities take effect after session refresh, ADMIN remains protected, unknown capabilities fail closed, and build, eslint, prettier, i18n parity, and endpoint-auth checks pass.
Written by the indexing model from the issue text.
Description
Part of #306 — Phase 1.
Goal
Introduce the capability model + DB-backed role matrix + admin editor, seeded to exactly match today's behavior (behavior-neutral until a toggle is flipped). Migrate page gates to capabilities.
Scope
- Capability list — a fixed, code-defined set (page/action to start): e.g.
manage_employees,manage_therapy_types,manage_schedule,manage_appointment_requests,assign_specialists,process_intake,create_referrals,write_therapy_notes,view_therapy_notes,manage_contact_forms,view_patients,view_schedule_all, … (finalize during build). RoleCapabilitymodel (role:UserType, capability: string,@@id([role, capability])) + migration + seed from current defaults (derive grants from today'scomputePermissions+pageAccessMapso nothing changes).computePermissions()reads the matrix for the user's role and returns the capability set (plus relationship-derived PATIENT/PARENT as today). Capabilities travel in the session viacustomSession.- Page gates: migrate
types/permissions.tspageAccessMapvalues from role → capability;middleware/01.permission.global.tsresolves the required capability from the session set. - Admin "Roles & Permissions" page (
/rolesor/permissions, ADMIN-gated, sidebar-linked): a roles × capabilities checkbox grid; save writesRoleCapability. i18n (en/es). - Guardrail: the ADMIN column is all-capabilities, locked/non-editable; API refuses any change that would leave ADMIN without full access or zero admins.
Out of scope (later phases)
Endpoint access migration + PHI/data capabilities + scope toggle (Phase 2); audit log + session invalidation + PHI warnings (Phase 3).
Acceptance criteria
- With the seeded matrix, app behavior is identical to today (page access unchanged).
- An admin can toggle a page capability for a role in the grid and it takes effect (after session refresh).
- ADMIN cannot be de-privileged / locked out.
- Fail-closed: a page with an unknown/missing capability denies.
- build + eslint + prettier + i18n parity + endpoint-auth check pass.
- Dominant language
- Vue
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from UTDallasEPICS/connected-care
-
area: auth enhancement P2: medium security
Difficulty 5/5 Over a week Newbie friendliness 35/100
UTDallasEPICS/connected-care#309 ·
-
area: auth enhancement P1: high security
Difficulty 5/5 Over a week Newbie friendliness 25/100
UTDallasEPICS/connected-care#308 ·
-
area: auth enhancement P1: high security
Difficulty 5/5 Over a week Newbie friendliness 25/100
UTDallasEPICS/connected-care#306 ·
-
area: patient area: schedule enhancement P2: medium
Difficulty 5/5 Over a week Newbie friendliness 35/100
UTDallasEPICS/connected-care#305 ·
-
area: patient enhancement P2: medium
Difficulty 4/5 3-5 days Newbie friendliness 35/100
UTDallasEPICS/connected-care#304 ·
All issues in UTDallasEPICS/connected-care
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
feature
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
calagopus/panel#285 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
manaflow-ai/cmux#32617 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ossf/wg-best-practices-os-developers#1193 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
laaielichter/Gulliver#22 ·
Maintainers usually reply within 1 day