MCPcopy Index your code
hub / github.com/coder/coder / AsPrebuild

Method AsPrebuild

coderd/database/modelmethods.go:538–545  ·  view source on GitHub ↗

AsPrebuild returns the RBAC object corresponding to the workspace type. If the workspace is a prebuild, it returns a prebuilt_workspace RBAC object. Otherwise, it returns a normal workspace RBAC object.

()

Source from the content-addressed store, hash-verified

536// If the workspace is a prebuild, it returns a prebuilt_workspace RBAC object.
537// Otherwise, it returns a normal workspace RBAC object.
538func (w WorkspaceTable) AsPrebuild() rbac.Object {
539 if w.IsPrebuild() {
540 return rbac.ResourcePrebuiltWorkspace.WithID(w.ID).
541 InOrg(w.OrganizationID).
542 WithOwner(w.OwnerID.String())
543 }
544 return w.RBACObject()
545}
546
547func (m OrganizationMember) RBACObject() rbac.Object {
548 return rbac.ResourceOrganizationMember.

Callers

nothing calls this directly

Calls 6

IsPrebuildMethod · 0.95
RBACObjectMethod · 0.95
WithOwnerMethod · 0.80
InOrgMethod · 0.80
WithIDMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected