MCPcopy Index your code
hub / github.com/apache/casbin / testGetAllowedObjectConditions

Function testGetAllowedObjectConditions

rbac_api_test.go:560–572  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, user string, act string, prefix string, res []string, expectedErr error)

Source from the content-addressed store, hash-verified

558}
559
560func testGetAllowedObjectConditions(t *testing.T, e *Enforcer, user string, act string, prefix string, res []string, expectedErr error) {
561 myRes, actualErr := e.GetAllowedObjectConditions(user, act, prefix)
562
563 if actualErr != expectedErr {
564 t.Error("actual Err: ", actualErr, ", supposed to be ", expectedErr)
565 }
566 if actualErr == nil {
567 log.Print("Policy: ", myRes)
568 if !util.ArrayEquals(res, myRes) {
569 t.Error("Policy: ", myRes, ", supposed to be ", res)
570 }
571 }
572}
573
574func TestGetAllowedObjectConditions(t *testing.T) {
575 e, _ := NewEnforcer("examples/object_conditions_model.conf", "examples/object_conditions_policy.csv")

Callers 1

Calls 3

ArrayEqualsFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…