- Platform roles for staff. Besides
userandadmin, an Admin can now make a Usersupport(feedback) oranalyst(analytics and errors). Onlyadminstill manages Users; the staff roles are for platform screens that check a permission withplatformProcedure, which re-reads the database session. See Roles and permissions. - Custom roles per Organization. An owner, an admin or anyone holding "Manage roles" defines up to 20 roles of its own (for example
coach) from a fixed list of permissions, on the roles screen at/admin/roles;/adminnow opens to any Member whose role grants one of its screens. Writes go through Better Auth's dynamic access control: you can only grant what you hold, a role still assigned cannot be deleted, roles are never renamed, and every create, update and delete is audited (org.role_created,org.role_updated,org.role_deleted). Owner and admin are built in and never lose "Manage roles". See Custom roles. - Permission checks in procedures.
requirePermission({ feedback: ["triage"] })afterorgProceduredecides from the Member's built-in and Custom roles, read under row-level security on every request, so an edited role counts on the next call. The neworganization_roletable and its grants are covered by the RLS isolation suite andtest:rls-matrix. See Guard a procedure. - Consent before sensitive data. A Member turns each category (measurements, health records, progress photos) on or off for their Organization, on the web account settings and on the app's Privacy screen; staff with
sensitiveData: readsee everyone's state at/admin/consent.sensitiveDataReadlets a procedure return another Member's sensitive data only with the permission and the subject's current Consent, and records asensitive_data.viewedAudit Event in the same transaction; withdrawing Consent hides the data on the next call. Grants and revokes are audited with their category, and the consent row keeps the text version it was given under (a grant under an older text no longer counts). See Consent for sensitive data and ADR-0016.
Roles, permissions and consent for sensitive data
Staff platform roles (support, analyst), Custom roles per Organization with a permission matrix, permission checks in procedures, and per-category Consent before anyone reads a Member's measurements, health records or progress photos.
Edit on GitHubDocumentation is in English.