MCPcopy Create free account
hub / github.com/apache/casbin-server / testEnforceWithoutUsers

Function testEnforceWithoutUsers

server/model_test.go:38–46  ·  view source on GitHub ↗
(t *testing.T, e *testEngine, obj string, act string, res bool)

Source from the content-addressed store, hash-verified

36}
37
38func testEnforceWithoutUsers(t *testing.T, e *testEngine, obj string, act string, res bool) {
39 t.Helper()
40 reply, err := e.s.Enforce(e.ctx, &pb.EnforceRequest{EnforcerHandler: e.h, Params: []string{obj, act}})
41 assert.NoError(t, err)
42
43 if reply.Res != res {
44 t.Errorf("%s, %s: %t, supposed to be %t", obj, act, !res, res)
45 }
46}
47
48func TestRBACModel(t *testing.T) {
49 s := NewServer()

Callers 1

TestPermissionAPIFunction · 0.85

Calls 1

EnforceMethod · 0.65

Tested by

no test coverage detected