(t *testing.T)
| 470 | } |
| 471 | |
| 472 | func 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 | |
| 482 | func testGetImplicitUsersForRole(t *testing.T, e *Enforcer, name string, res []string) { |
| 483 | t.Helper() |
nothing calls this directly
no test coverage detected
searching dependent graphs…