(sec string, ptype string, oldRule []string, newRule []string)
| 443 | } |
| 444 | |
| 445 | func (e *Enforcer) updatePolicy(sec string, ptype string, oldRule []string, newRule []string) (bool, error) { |
| 446 | ok, err := e.updatePolicyWithoutNotify(sec, ptype, oldRule, newRule) |
| 447 | if !ok || err != nil { |
| 448 | return ok, err |
| 449 | } |
| 450 | |
| 451 | if e.shouldNotify() { |
| 452 | var err error |
| 453 | if watcher, ok := e.watcher.(persist.UpdatableWatcher); ok { |
| 454 | err = watcher.UpdateForUpdatePolicy(sec, ptype, oldRule, newRule) |
| 455 | } else { |
| 456 | err = e.watcher.Update() |
| 457 | } |
| 458 | return true, err |
| 459 | } |
| 460 | |
| 461 | return true, nil |
| 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) |
no test coverage detected