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

Function TestBuiltInRoles

coderd/rbac/roles_test.go:37–52  ·  view source on GitHub ↗

TestBuiltInRoles makes sure our built-in roles are valid by our own policy rules. If this is incorrect, that is a mistake.

(t *testing.T)

Source from the content-addressed store, hash-verified

35// TestBuiltInRoles makes sure our built-in roles are valid by our own policy
36// rules. If this is incorrect, that is a mistake.
37func TestBuiltInRoles(t *testing.T) {
38 t.Parallel()
39 for _, r := range rbac.SiteBuiltInRoles() {
40 t.Run(r.Identifier.String(), func(t *testing.T) {
41 t.Parallel()
42 require.NoError(t, r.Valid(), "invalid role")
43 })
44 }
45
46 for _, r := range rbac.OrganizationRoles(uuid.New()) {
47 t.Run(r.Identifier.String(), func(t *testing.T) {
48 t.Parallel()
49 require.NoError(t, r.Valid(), "invalid role")
50 })
51 }
52}
53
54// permissionGranted checks whether a permission list contains a
55// matching entry for the target, accounting for wildcard actions.

Callers

nothing calls this directly

Calls 6

SiteBuiltInRolesFunction · 0.92
OrganizationRolesFunction · 0.92
RunMethod · 0.65
ValidMethod · 0.65
NewMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected