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

Function orgMemberRole

coderd/rbac/authz_internal_test.go:1406–1421  ·  view source on GitHub ↗

orgMemberRole returns an organization-member role for RBAC-only tests. organization-member is now a DB-backed system role (not a built-in role), so RoleByName won't resolve it here. Assume the default behavior: workspace sharing enabled.

(orgID uuid.UUID)

Source from the content-addressed store, hash-verified

1404// RoleByName won't resolve it here. Assume the default behavior: workspace
1405// sharing enabled.
1406func orgMemberRole(orgID uuid.UUID) Role {
1407 settings := OrgSettings{ShareableWorkspaceOwners: ShareableWorkspaceOwnersEveryone}
1408 perms := OrgMemberPermissions(settings)
1409 return Role{
1410 Identifier: ScopedRoleOrgMember(orgID),
1411 DisplayName: "",
1412 Site: []Permission{},
1413 User: []Permission{},
1414 ByOrgID: map[string]OrgPermissions{
1415 orgID.String(): {
1416 Org: perms.Org,
1417 Member: perms.Member,
1418 },
1419 },
1420 }
1421}
1422
1423func must[T any](value T, err error) T {
1424 if err != nil {

Callers 2

TestAuthorizeDomainFunction · 0.85
TestAuthorizeScopeFunction · 0.85

Calls 3

OrgMemberPermissionsFunction · 0.85
ScopedRoleOrgMemberFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected