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

Function requirePermission

coderd/database/modelmethods_internal_test.go:225–233  ·  view source on GitHub ↗

Helpers

(t *testing.T, s rbac.Scope, resource string, action policy.Action)

Source from the content-addressed store, hash-verified

223
224// Helpers
225func 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
235func requireAllowAll(t *testing.T, s rbac.Scope) {
236 t.Helper()

Callers 1

TestAPIKeyScopesExpandFunction · 0.85

Calls 2

HelperMethod · 0.65
FatalfMethod · 0.45

Tested by

no test coverage detected