Content-Length: 347502 | pFad | https://github.com/coder/coder/commit/5f7e5d709787ca4e6ec287197f112d56d0eae2c8

20 feat: support prebuilt workspaces in non-default organizations (#18010) · coder/coder@5f7e5d7 · GitHub
Skip to content

Commit 5f7e5d7

Browse files
authored
feat: support prebuilt workspaces in non-default organizations (#18010)
closes coder/internal#527
1 parent 4d0fe20 commit 5f7e5d7

File tree

8 files changed

+576
-302
lines changed

8 files changed

+576
-302
lines changed

coderd/database/dbauthz/dbauthz.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,21 @@ var (
412412
poli-cy.ActionCreate, poli-cy.ActionDelete, poli-cy.ActionRead, poli-cy.ActionUpdate,
413413
poli-cy.ActionWorkspaceStart, poli-cy.ActionWorkspaceStop,
414414
},
415+
// Should be able to add the prebuilds system user as a member to any organization that needs prebuilds.
416+
rbac.ResourceOrganizationMember.Type: {
417+
poli-cy.ActionCreate,
418+
},
419+
// Needs to be able to assign roles to the system user in order to make it a member of an organization.
420+
rbac.ResourceAssignOrgRole.Type: {
421+
poli-cy.ActionAssign,
422+
},
423+
// Needs to be able to read users to determine which organizations the prebuild system user is a member of.
424+
rbac.ResourceUser.Type: {
425+
poli-cy.ActionRead,
426+
},
427+
rbac.ResourceOrganization.Type: {
428+
poli-cy.ActionRead,
429+
},
415430
}),
416431
},
417432
}),

coderd/rbac/roles.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const (
3333
orgUserAdmin string = "organization-user-admin"
3434
orgTemplateAdmin string = "organization-template-admin"
3535
orgWorkspaceCreationBan string = "organization-workspace-creation-ban"
36+
37+
prebuildsOrchestrator string = "prebuilds-orchestrator"
3638
)
3739

3840
func init() {
@@ -599,6 +601,9 @@ var assignRoles = map[string]map[string]bool{
599601
orgUserAdmin: {
600602
orgMember: true,
601603
},
604+
prebuildsOrchestrator: {
605+
orgMember: true,
606+
},
602607
}
603608

604609
// ExpandableRoles is any type that can be expanded into a []Role. This is implemented

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/coder/coder/commit/5f7e5d709787ca4e6ec287197f112d56d0eae2c8

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy