Files
coder/coderd/database/migrations/000516_org_default_member_roles.up.sql
T
Steven Masley 938c2080f3 feat: configurable default org member roles (#25994)
Refs #25936. 
Adds a configurable per-org default member role set. Unioned into each member's effective roles at read time.

<sub>with Coder Agents on behalf of @Emyrk.</sub>
2026-06-05 14:33:13 -05:00

17 lines
708 B
SQL

ALTER TABLE organizations
ADD COLUMN default_org_member_roles text[];
UPDATE organizations
SET default_org_member_roles = ARRAY['organization-workspace-access']::text[];
ALTER TABLE organizations
ALTER COLUMN default_org_member_roles SET NOT NULL;
COMMENT ON COLUMN organizations.default_org_member_roles IS
'Roles granted to every member of this organization at request time. '
'The set is unioned into each member''s effective roles when '
'GetAuthorizationUserRoles runs, so changes propagate to all members '
'on the next request. Deployments can use this column to revoke '
'capabilities that would otherwise be considered normal organization '
'member permissions.';