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

Method AssertInOrder

coderd/coderdtest/authorize.go:102–109  ·  view source on GitHub ↗

AssertInOrder must be called in the correct order of authz checks. If the objects or actions are not in the correct order, the test will fail.

(t *testing.T, action policy.Action, objects ...interface{})

Source from the content-addressed store, hash-verified

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.
102func (a RBACAsserter) AssertInOrder(t *testing.T, action policy.Action, objects ...interface{}) {
103 converted := a.convertObjects(t, objects...)
104 pairs := make([]ActionObjectPair, 0, len(converted))
105 for _, obj := range converted {
106 pairs = append(pairs, a.Recorder.Pair(action, obj))
107 }
108 a.Recorder.AssertActor(t, a.Subject, pairs...)
109}
110
111// convertObjects converts the codersdk types to rbac.Object. Unfortunately
112// does not have type safety, and instead uses a t.Fatal to enforce types.

Callers

nothing calls this directly

Calls 3

convertObjectsMethod · 0.95
PairMethod · 0.80
AssertActorMethod · 0.80

Tested by

no test coverage detected