mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: join owner, template, and org in new workspace view (#15116)
Joins in fields like `username`, `avatar_url`, `organization_name`, `template_name` to `workspaces` via a **view**. The view must be maintained moving forward, but this prevents needing to add RBAC permissions to fetch related workspace fields.
This commit is contained in:
@ -1461,15 +1461,6 @@ func userOrganizationIDs(ctx context.Context, api *API, user database.User) ([]u
|
||||
return member.OrganizationIDs, nil
|
||||
}
|
||||
|
||||
func userByID(id uuid.UUID, users []database.User) (database.User, bool) {
|
||||
for _, user := range users {
|
||||
if id == user.ID {
|
||||
return user, true
|
||||
}
|
||||
}
|
||||
return database.User{}, false
|
||||
}
|
||||
|
||||
func convertAPIKey(k database.APIKey) codersdk.APIKey {
|
||||
return codersdk.APIKey{
|
||||
ID: k.ID,
|
||||
|
Reference in New Issue
Block a user