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

Method HasPolicy

management_api.go:215–217  ·  view source on GitHub ↗

HasPolicy determines whether an authorization rule exists.

(params ...interface{})

Source from the content-addressed store, hash-verified

213
214// HasPolicy determines whether an authorization rule exists.
215func (e *Enforcer) HasPolicy(params ...interface{}) (bool, error) {
216 return e.HasNamedPolicy("p", params...)
217}
218
219// HasNamedPolicy determines whether a named authorization rule exists.
220func (e *Enforcer) HasNamedPolicy(ptype string, params ...interface{}) (bool, error) {

Callers 4

BenchmarkHasPolicySmallFunction · 0.95
BenchmarkHasPolicyMediumFunction · 0.95
BenchmarkHasPolicyLargeFunction · 0.95
HasPermissionForUserMethod · 0.95

Calls 1

HasNamedPolicyMethod · 0.95

Tested by 3

BenchmarkHasPolicySmallFunction · 0.76
BenchmarkHasPolicyMediumFunction · 0.76
BenchmarkHasPolicyLargeFunction · 0.76