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>
This commit is contained in:
Steven Masley
2026-06-05 14:33:13 -05:00
committed by GitHub
parent 2ef468ef76
commit 938c2080f3
40 changed files with 635 additions and 174 deletions
+4 -3
View File
@@ -116,10 +116,10 @@ SELECT
-- name: InsertOrganization :one
INSERT INTO
organizations (id, "name", display_name, description, icon, created_at, updated_at, is_default)
organizations (id, "name", display_name, description, icon, created_at, updated_at, is_default, default_org_member_roles)
VALUES
-- If no organizations exist, and this is the first, make it the default.
(@id, @name, @display_name, @description, @icon, @created_at, @updated_at, (SELECT TRUE FROM organizations LIMIT 1) IS NULL) RETURNING *;
(@id, @name, @display_name, @description, @icon, @created_at, @updated_at, (SELECT TRUE FROM organizations LIMIT 1) IS NULL, @default_org_member_roles) RETURNING *;
-- name: UpdateOrganization :one
UPDATE
@@ -129,7 +129,8 @@ SET
name = @name,
display_name = @display_name,
description = @description,
icon = @icon
icon = @icon,
default_org_member_roles = @default_org_member_roles
WHERE
id = @id
RETURNING *;