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

Function TestGetList

management_api_test.go:37–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestGetList(t *testing.T) {
38 e, _ := NewEnforcer("examples/rbac_model.conf", "examples/rbac_policy.csv")
39
40 testStringList(t, "Subjects", e.GetAllSubjects, []string{"alice", "bob", "data2_admin"})
41 testStringList(t, "Objects", e.GetAllObjects, []string{"data1", "data2"})
42 testStringList(t, "Actions", e.GetAllActions, []string{"read", "write"})
43 testStringList(t, "Roles", e.GetAllRoles, []string{"data2_admin"})
44 testStringList(t, "Users", e.GetAllUsers, []string{"alice", "bob"})
45}
46
47func TestGetListWithDomains(t *testing.T) {
48 e, _ := NewEnforcer("examples/rbac_with_domains_model.conf", "examples/rbac_with_domains_policy.csv")

Callers

nothing calls this directly

Calls 2

NewEnforcerFunction · 0.85
testStringListFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…