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

Function TestGetImplicitResourcesForUser

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

Source from the content-addressed store, hash-verified

448}
449
450func TestGetImplicitResourcesForUser(t *testing.T) {
451 e, _ := NewEnforcer("examples/rbac_with_pattern_model.conf", "examples/rbac_with_pattern_policy.csv")
452 testGetImplicitResourcesForUser(t, e, [][]string{
453 {"alice", "/pen/1", "GET"},
454 {"alice", "/pen2/1", "GET"},
455 {"alice", "/book/:id", "GET"},
456 {"alice", "/book2/{id}", "GET"},
457 {"alice", "/book/*", "GET"},
458 {"alice", "book_group", "GET"},
459 }, "alice")
460 testGetImplicitResourcesForUser(t, e, [][]string{
461 {"bob", "pen_group", "GET"},
462 {"bob", "/pen/:id", "GET"},
463 {"bob", "/pen2/{id}", "GET"},
464 }, "bob")
465 testGetImplicitResourcesForUser(t, e, [][]string{
466 {"cathy", "pen_group", "GET"},
467 {"cathy", "/pen/:id", "GET"},
468 {"cathy", "/pen2/{id}", "GET"},
469 }, "cathy")
470}
471
472func TestImplicitUsersForRole(t *testing.T) {
473 e, _ := NewEnforcer("examples/rbac_with_pattern_model.conf", "examples/rbac_with_pattern_policy.csv")

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…