Skip to content
hs-sql-agent
2.0.2
Docs 2.0.2
Docs Administration

Members & Roles

Manage Admin users, sessions, role assignment, and role lifecycle in hs-sql-agent 2.0.1.

Members Create Admin users, activate or disable accounts, and inspect assigned roles and active sessions.
Roles Bundle allowed permission/action pairs into reusable authorization roles.
Session invalidation Security-sensitive member or role changes invalidate affected runtime authorization state.

Admin members are identities for the control plane. They are separate from MCP keys, which authenticate /mcp clients.

Member lifecycle

01 Create member
02 Assign roles
03 Operate Admin UI
04 Change access
05 Revoke sessions when needed

A new member requires a valid email and a password of at least 8 characters. Username is optional and limited to 100 characters. At creation time an operator can assign explicit role IDs or request all roles.

The member list can be filtered by search text, active status, and role, and is paginated. The 2.0.1 member view reports account state, creation/last-login time, active session count, and current role IDs/names.

Administrative member actions

ActionPermissionImportant guardrail
create member/auth/usercreateemail/password validation applies
list/search members/auth/userviewsupports status/role/search filters
replace member roles/auth/useredityou cannot change your own roles
activate / disable account/auth/useredityou cannot disable yourself
revoke all member sessions/auth/usereditimmediately invalidates that member’s sessions
require password change/auth/usereditflag is enforced on the next sign-in
delete member/auth/userdeleteyou cannot delete yourself

Roles

A role has a unique name, optional description, and a set of permission/action selections. Role assignment is many-to-many: a member may hold multiple roles and a role may be assigned to multiple members.

The built-in SuperUser role is protected. It cannot be modified or deleted, and a new or renamed role cannot use that protected identity.

Editing a role changes active authorization state

When a role’s permission set changes, 2.0.1 identifies members assigned to that role, increments their security version, and performs the mutation through the auth runtime-state cache barrier. This prevents an already authenticated session from continuing indefinitely with stale role authorization.

The same principle applies when a role assigned to members is removed.

Delete dependencies before deleting a role

The role dependency endpoint reports both:

  • permission/action entries attached to the role; and
  • members currently assigned to it.

Deleting a role that still has assigned members is rejected by default. An explicit force=true path exists, but operators should inspect dependencies first because affected members lose that role and their security state is invalidated.

Password and session response

Member administration can mark an account as requiring password change on next sign-in and can revoke all sessions for a target member. Users can also manage their own sessions through the Auth API.

For the authorization model behind roles, continue with Permissions.