MCPcopy
hub / github.com/apache/casbin / testGetImplicitObjectPatternsForUser

Function testGetImplicitObjectPatternsForUser

rbac_api_test.go:848–859  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, user string, domain string, action string, res []string)

Source from the content-addressed store, hash-verified

846}
847
848func testGetImplicitObjectPatternsForUser(t *testing.T, e *Enforcer, user string, domain string, action string, res []string) {
849 t.Helper()
850 myRes, err := e.GetImplicitObjectPatternsForUser(user, domain, action)
851 if err != nil {
852 t.Error("Implicit object patterns for ", user, " under domain ", domain, " with action ", action, " could not be fetched: ", err.Error())
853 }
854 t.Log("Implicit object patterns for ", user, " under domain ", domain, " with action ", action, ": ", myRes)
855
856 if !util.SetEquals(res, myRes) {
857 t.Error("Implicit object patterns for ", user, " under domain ", domain, " with action ", action, ": ", myRes, ", supposed to be ", res)
858 }
859}
860
861func TestGetImplicitObjectPatternsForUser(t *testing.T) {
862 // Test with domain pattern model

Callers 1

Calls 3

SetEqualsFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…