Groups
PartialA group is a named set of entities that cuts across the structural trees. The tree handles configuration by position and kind; a group handles it by attribute or by a hand-picked set (“all AV displays”). One primitive is meant to serve two jobs, a cascade overlay and an access scope, which an anonymous predicate cannot.
What is built: user groups
Section titled “What is built: user groups”Built end to end is the user kind: user_group and its membership, group-targeted grants
(user_grant.group_id), the effective-grant union in the loader, /user-groups CRUD gated by
user_group:*, and the console User groups pages. A user group is a grant subject: a grant
attached to the group reaches its members. It is not yet an access scope, and scope_kind='group' is
refused with a 422.
- A group’s name is an ordinary entity name, checked by the Storage Gateway, the one layer every database read and write passes through, on create and rename (ADR-0077).
- Renaming is the
:renamecustom method, gated byuser_group:rename; the PATCH body carries no name (ADR-0076). Membership and grants key on the group’s uuid, so a rename moves nothing. - Every route takes the group by name or uuid, and a member by username, machine user name or uuid (ADR-1133), resolved only after the all-scope check so a scoped caller learns nothing about which names exist.
| Column | Type | Constraints |
|---|---|---|
id | uuid | PK, default uuidv7() |
name | text | not null |
label | text | |
description | text | |
created_at | timestamp with time zone | not null, default now() |
updated_at | timestamp with time zone | not null, default now() |
CHECK constraints and unique indexes on user_group
-
user_group_name_key:CREATE UNIQUE INDEX user_group_name_key ON public.user_group USING btree (name)
| Column | Type | Constraints |
|---|---|---|
group_id | uuid | PK, FK → user_group.id |
user_id | uuid | PK, FK → users.id |
created_at | timestamp with time zone | not null, default now() |
source | text | not null, default 'local'::text |
issuer | text |
CHECK constraints and unique indexes on user_group_member
-
user_group_member_source_check:CHECK ( CASE WHEN (source = 'idp'::text) THEN ((issuer IS NOT NULL) AND (issuer <> ''::text)) WHEN (source = 'local'::text) THEN (issuer IS NULL) ELSE false END)