(sec string, ptype string, oldRules [][]string, newRules [][]string)
| 462 | } |
| 463 | |
| 464 | func (e *Enforcer) updatePolicies(sec string, ptype string, oldRules [][]string, newRules [][]string) (bool, error) { |
| 465 | ok, err := e.updatePoliciesWithoutNotify(sec, ptype, oldRules, newRules) |
| 466 | if !ok || err != nil { |
| 467 | return ok, err |
| 468 | } |
| 469 | |
| 470 | if e.shouldNotify() { |
| 471 | var err error |
| 472 | if watcher, ok := e.watcher.(persist.UpdatableWatcher); ok { |
| 473 | err = watcher.UpdateForUpdatePolicies(sec, ptype, oldRules, newRules) |
| 474 | } else { |
| 475 | err = e.watcher.Update() |
| 476 | } |
| 477 | return true, err |
| 478 | } |
| 479 | |
| 480 | return true, nil |
| 481 | } |
| 482 | |
| 483 | // removePolicies removes rules from the current policy. |
| 484 | func (e *Enforcer) removePolicies(sec string, ptype string, rules [][]string) (bool, error) { |
no test coverage detected