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)
| 494 | // to skip some RBAC checks. This check in testing would prevent the ability |
| 495 | // to assert the more nuanced RBAC checks. |
| 496 | func (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 | |
| 501 | func (m *expects) WithNotAuthorized(contains string) *expects { |
| 502 | m.notAuthorizedExpect = contains |
no outgoing calls
no test coverage detected