Skip to content

Scrims · Permissions

2 modules · 22 exports · 4 repositories · 12 e2e tests · 3 routes

Who may do what in Scrims: the per-object permissions it builds with every place checking them, and the checks in its code. See Permissions for how authorization works and the reference for every role and feature.

Granted here

Built at read time into what the functions return, a list of the user ids holding each permission. Checks are listed wherever they are, other features' included.

PermissionGranted byChecked in
MANAGE_REQUESTS

on ScrimPost

mapDBRowToScrimPost
managerIds = row.managedByAnyone
	? users.map((user) => user.id)
	: ownerIds

declared by ScrimPost

read directly scrims.tsx
DELETE_POST

on ScrimPost

mapDBRowToScrimPost
managerIds = row.managedByAnyone
	? users.map((user) => user.id)
	: ownerIds

declared by ScrimPost

read directly scrims.tsx
CANCEL

on ScrimPost

mapDBRowToScrimPost
managerIds.concat(requests.at(0)?.users.map((u) => u.id) ?? [])

declared by ScrimPost

MANAGE_TRACKING

on ScrimPost

mapDBRowToScrimPost
someRequestIsAccepted
	? users
			.map((u) => u.id)
			.concat(requests[0]?.users.map((u) => u.id) ?? [])
	: []

declared by ScrimPost

CANCEL

on ScrimPostRequest

mapDBRowToScrimPost
request.users.map((u) => u.id)

declared by ScrimPostRequest

Outside the system

Reading x.permissions.NAME directly skips hasPermission and with it the admin bypass, and authorizing an action on an object with isAdmin and friends is a bug. Some of these are deliberate, the permissions doc lists the boundaries.