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

Method RBACObject

coderd/database/modelmethods.go:503–520  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

501}
502
503func (w WorkspaceTable) RBACObject() rbac.Object {
504 if w.DormantAt.Valid {
505 return w.DormantRBAC()
506 }
507
508 obj := rbac.ResourceWorkspace.
509 WithID(w.ID).
510 InOrg(w.OrganizationID).
511 WithOwner(w.OwnerID.String())
512
513 if rbac.WorkspaceACLDisabled() {
514 return obj
515 }
516
517 return obj.
518 WithGroupACL(w.GroupACL.RBACACL()).
519 WithACLUserList(w.UserACL.RBACACL())
520}
521
522func (w WorkspaceTable) DormantRBAC() rbac.Object {
523 return rbac.ResourceWorkspaceDormant.

Callers 2

AsPrebuildMethod · 0.95
TestWorkspaceACLDisabledFunction · 0.95

Calls 9

DormantRBACMethod · 0.95
WorkspaceACLDisabledFunction · 0.92
WithOwnerMethod · 0.80
InOrgMethod · 0.80
WithACLUserListMethod · 0.80
WithGroupACLMethod · 0.80
WithIDMethod · 0.45
StringMethod · 0.45
RBACACLMethod · 0.45

Tested by 1

TestWorkspaceACLDisabledFunction · 0.76