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

Method WithSuccessAuthorizer

coderd/database/dbauthz/setup_test.go:496–499  ·  view source on GitHub ↗

WithSuccessAuthorizer is helpful when an optimization authz check is made to skip some RBAC checks. This check in testing would prevent the ability to assert the more nuanced RBAC checks.

(f func(ctx context.Context, subject rbac.Subject, action policy.Action, obj rbac.Object) error)

Source from the content-addressed store, hash-verified

494// to skip some RBAC checks. This check in testing would prevent the ability
495// to assert the more nuanced RBAC checks.
496func (m *expects) WithSuccessAuthorizer(f func(ctx context.Context, subject rbac.Subject, action policy.Action, obj rbac.Object) error) *expects {
497 m.successAuthorizer = f
498 return m
499}
500
501func (m *expects) WithNotAuthorized(contains string) *expects {
502 m.notAuthorizedExpect = contains

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected