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

Function testGetNamedImplicitPermissions

rbac_api_test.go:349–357  ·  view source on GitHub ↗
(t *testing.T, e *Enforcer, ptype string, gtype string, name string, res [][]string)

Source from the content-addressed store, hash-verified

347}
348
349func testGetNamedImplicitPermissions(t *testing.T, e *Enforcer, ptype string, gtype string, name string, res [][]string) {
350 t.Helper()
351 myRes, _ := e.GetNamedImplicitPermissionsForUser(ptype, gtype, name)
352 t.Log("Named implicit permissions for ", name, ": ", myRes)
353
354 if !util.Set2DEquals(res, myRes) {
355 t.Error("Named implicit permissions for ", name, ": ", myRes, ", supposed to be ", res)
356 }
357}
358
359func TestImplicitPermissionAPI(t *testing.T) {
360 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_with_hierarchy_policy.csv")

Callers 1

Calls 3

Set2DEqualsFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…