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)
| 35 | // TestBuiltInRoles makes sure our built-in roles are valid by our own policy |
| 36 | // rules. If this is incorrect, that is a mistake. |
| 37 | func 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. |
nothing calls this directly
no test coverage detected