MCPcopy
hub / github.com/apache/casbin / BenchmarkRBACModelWithResourceRoles

Function BenchmarkRBACModelWithResourceRoles

model_b_test.go:214–221  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

212}
213
214func BenchmarkRBACModelWithResourceRoles(b *testing.B) {
215 e, _ := NewEnforcer("examples/rbac_with_resource_roles_model.conf", "examples/rbac_with_resource_roles_policy.csv")
216
217 b.ResetTimer()
218 for i := 0; i < b.N; i++ {
219 _, _ = e.Enforce("alice", "data1", "read")
220 }
221}
222
223func BenchmarkRBACModelWithDomains(b *testing.B) {
224 e, _ := NewEnforcer("examples/rbac_with_domains_model.conf", "examples/rbac_with_domains_policy.csv")

Callers

nothing calls this directly

Calls 2

EnforceMethod · 0.95
NewEnforcerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…