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

Method AssertChecked

coderd/coderdtest/authorize.go:91–98  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

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.
91func (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.

Callers 4

TestWorkspaceFunction · 0.80
TestTemplateVersionFunction · 0.80
TestDebugCollectProfileFunction · 0.80
TestDeleteUserFunction · 0.80

Calls 3

convertObjectsMethod · 0.95
PairMethod · 0.80
AssertOutOfOrderMethod · 0.80

Tested by 4

TestWorkspaceFunction · 0.64
TestTemplateVersionFunction · 0.64
TestDebugCollectProfileFunction · 0.64
TestDeleteUserFunction · 0.64