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

Function BenchmarkABACModel

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

Source from the content-addressed store, hash-verified

230}
231
232func BenchmarkABACModel(b *testing.B) {
233 e, _ := NewEnforcer("examples/abac_model.conf")
234 data1 := newTestResource("data1", "alice")
235
236 b.ResetTimer()
237 for i := 0; i < b.N; i++ {
238 _, _ = e.Enforce("alice", data1, "read")
239 }
240}
241
242func BenchmarkABACRuleModel(b *testing.B) {
243 e, _ := NewEnforcer("examples/abac_rule_model.conf")

Callers

nothing calls this directly

Calls 3

EnforceMethod · 0.95
NewEnforcerFunction · 0.85
newTestResourceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…