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.
()
| 536 | // If the workspace is a prebuild, it returns a prebuilt_workspace RBAC object. |
| 537 | // Otherwise, it returns a normal workspace RBAC object. |
| 538 | func (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 | |
| 547 | func (m OrganizationMember) RBACObject() rbac.Object { |
| 548 | return rbac.ResourceOrganizationMember. |
nothing calls this directly
no test coverage detected