(t *testing.T)
| 621 | } |
| 622 | |
| 623 | func TestGetImplicitUsersForResource(t *testing.T) { |
| 624 | e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv") |
| 625 | testGetImplicitUsersForResource(t, e, [][]string{{"alice", "data1", "read"}}, "data1") |
| 626 | testGetImplicitUsersForResource(t, e, [][]string{{"bob", "data2", "write"}, |
| 627 | {"alice", "data2", "read"}, |
| 628 | {"alice", "data2", "write"}}, "data2") |
| 629 | |
| 630 | // test duplicate permissions |
| 631 | _, _ = e.AddGroupingPolicy("alice", "data2_admin_2") |
| 632 | _, _ = e.AddPolicies([][]string{{"data2_admin_2", "data2", "read"}, {"data2_admin_2", "data2", "write"}}) |
| 633 | testGetImplicitUsersForResource(t, e, [][]string{{"bob", "data2", "write"}, |
| 634 | {"alice", "data2", "read"}, |
| 635 | {"alice", "data2", "write"}}, "data2") |
| 636 | } |
| 637 | |
| 638 | func TestGetImplicitUsersForResourceWithResourceRoles(t *testing.T) { |
| 639 | e, _ := NewEnforcer("examples/rbac_with_resource_roles_model.conf", "examples/rbac_with_resource_roles_policy.csv") |
nothing calls this directly
no test coverage detected
searching dependent graphs…