mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
feat: add sharing info to /workspaces endpoint (#21049)
closes: https://github.com/coder/internal/issues/858 Similar to https://github.com/coder/coder/pull/19375, this one uses system permissions for fetching actual user and group data. Modifies the `workspaces_expanded` view to fetch the required data; this way it's made available to all code paths that make use of it. Also fixes a bug in a test helper function that can result in `null` being saved to the DB for `user_acl` or `group_acl` and break tests; a defensive check constraint that prevents this is worth a PR, e.g: `ALTER TABLE workspaces ADD CONSTRAINT group_acl_is_object CHECK (jsonb_typeof(group_acl) = 'object');` Also adds missing `OwnerName` in `ConvertWorkspaceRows`.
This commit is contained in:
@@ -91,6 +91,12 @@ sql:
|
||||
- column: "workspaces_expanded.group_acl"
|
||||
go_type:
|
||||
type: "WorkspaceACL"
|
||||
- column: "workspaces_expanded.user_acl_display_info"
|
||||
go_type:
|
||||
type: "WorkspaceACLDisplayInfo"
|
||||
- column: "workspaces_expanded.group_acl_display_info"
|
||||
go_type:
|
||||
type: "WorkspaceACLDisplayInfo"
|
||||
- column: "notification_templates.actions"
|
||||
go_type:
|
||||
type: "[]byte"
|
||||
@@ -159,6 +165,8 @@ sql:
|
||||
jwt: JWT
|
||||
user_acl: UserACL
|
||||
group_acl: GroupACL
|
||||
user_acl_display_info: UserACLDisplayInfo
|
||||
group_acl_display_info: GroupACLDisplayInfo
|
||||
troubleshooting_url: TroubleshootingURL
|
||||
default_ttl: DefaultTTL
|
||||
motd_file: MOTDFile
|
||||
|
||||
Reference in New Issue
Block a user