mono.email_template, change an existing person's role, or deactivate an account by setting enabled = false.profile row is created or updated, and the change is written to audit_log with before_state and after_state. Role is what row-level security, the database's per-user access rules, keys off, so a role change takes effect on the person's very next query, with no redeploy and no cache. An invited enrollee gets a handle from a running counter (for example enrollee-0001); staff handles are readable. The handle keeps names off the screens, but it is sequential and stable across studies, so it is not anonymity — the blinding the platform enforces is experiment.blinded.profile, audit_log reads email_template| If… | Then… |
|---|---|
| They demote or deactivate the last remaining admin | Refused: it would lock everyone out of the install permanently. |
| They want a person gone | They deactivate: enabled = false blocks sign-in and keeps every row the person produced, so finished studies stay intact and attributable. Hard-deleting a profile is not offered. |
| The email is already in use | Refused: profile.email is unique across the install. |
| They try to change a person's email | Not from here: the person changes it through the login service's verified flow, and this copy follows. |
audit_log entry records both states; and attempting to demote the now-only admin is refused.Everything here is invite-only, so somebody has to let people in. That somebody is an admin, and in ChatMaestro the admin is the owner; there is no separate super-user account hiding behind it.
There are three roles, and they are deliberately coarse. Enrollees take part in studies. Experimenters design and run them. Admins also manage people, models, and documents. Those roles are not just menu options; the database itself enforces them, so an enrollee cannot read another enrollee's transcript even if something in the app misbehaves.
There are two guard rails. You cannot remove the last admin, because that would lock everybody out of the install for good. And you never delete a person; you switch them off. Their finished work stays where it is, still correctly attributed.
profile.role + enabled are the whole model; the last-admin lock is a rule, not a column.