AssertChecked will assert a given rbac check was performed. It does not care about order of checks, or any other checks. This is useful when you do not care about asserting every check that was performed.
(t *testing.T, action policy.Action, objects ...interface{})
| 89 | // about order of checks, or any other checks. This is useful when you do not |
| 90 | // care about asserting every check that was performed. |
| 91 | func (a RBACAsserter) AssertChecked(t *testing.T, action policy.Action, objects ...interface{}) { |
| 92 | converted := a.convertObjects(t, objects...) |
| 93 | pairs := make([]ActionObjectPair, 0, len(converted)) |
| 94 | for _, obj := range converted { |
| 95 | pairs = append(pairs, a.Recorder.Pair(action, obj)) |
| 96 | } |
| 97 | a.Recorder.AssertOutOfOrder(t, a.Subject, pairs...) |
| 98 | } |
| 99 | |
| 100 | // AssertInOrder must be called in the correct order of authz checks. If the objects |
| 101 | // or actions are not in the correct order, the test will fail. |