(t *testing.T)
| 448 | } |
| 449 | |
| 450 | func 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 | |
| 472 | func TestImplicitUsersForRole(t *testing.T) { |
| 473 | e, _ := NewEnforcer("examples/rbac_with_pattern_model.conf", "examples/rbac_with_pattern_policy.csv") |
nothing calls this directly
no test coverage detected
searching dependent graphs…