HasPolicy determines whether an authorization rule exists.
(params ...interface{})
| 350 | |
| 351 | // HasPolicy determines whether an authorization rule exists. |
| 352 | func (e *SyncedEnforcer) HasPolicy(params ...interface{}) (bool, error) { |
| 353 | e.m.RLock() |
| 354 | defer e.m.RUnlock() |
| 355 | return e.Enforcer.HasPolicy(params...) |
| 356 | } |
| 357 | |
| 358 | // HasNamedPolicy determines whether a named authorization rule exists. |
| 359 | func (e *SyncedEnforcer) HasNamedPolicy(ptype string, params ...interface{}) (bool, error) { |