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

Function TestImplicitUsersForRole

rbac_api_test.go:472–480  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

470}
471
472func TestImplicitUsersForRole(t *testing.T) {
473 e, _ := NewEnforcer("examples/rbac_with_pattern_model.conf", "examples/rbac_with_pattern_policy.csv")
474
475 testGetImplicitUsersForRole(t, e, "book_admin", []string{"alice"})
476 testGetImplicitUsersForRole(t, e, "pen_admin", []string{"cathy", "bob"})
477
478 testGetImplicitUsersForRole(t, e, "book_group", []string{"/book/*", "/book/:id", "/book2/{id}"})
479 testGetImplicitUsersForRole(t, e, "pen_group", []string{"/pen/:id", "/pen2/{id}"})
480}
481
482func testGetImplicitUsersForRole(t *testing.T, e *Enforcer, name string, res []string) {
483 t.Helper()

Callers

nothing calls this directly

Calls 2

NewEnforcerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…