Helpers
(t *testing.T, s rbac.Scope, resource string, action policy.Action)
| 223 | |
| 224 | // Helpers |
| 225 | func requirePermission(t *testing.T, s rbac.Scope, resource string, action policy.Action) { |
| 226 | t.Helper() |
| 227 | for _, p := range s.Site { |
| 228 | if p.ResourceType == resource && p.Action == action { |
| 229 | return |
| 230 | } |
| 231 | } |
| 232 | t.Fatalf("permission not found: %s:%s", resource, action) |
| 233 | } |
| 234 | |
| 235 | func requireAllowAll(t *testing.T, s rbac.Scope) { |
| 236 | t.Helper() |
no test coverage detected