(ctx context.Context, sec string, ptype string, oldRule []string, newRule []string)
| 687 | } |
| 688 | |
| 689 | func (e *ContextEnforcer) updatePolicyCtx(ctx context.Context, sec string, ptype string, oldRule []string, newRule []string) (bool, error) { |
| 690 | ok, err := e.updatePolicyWithoutNotifyCtx(ctx, sec, ptype, oldRule, newRule) |
| 691 | if !ok || err != nil { |
| 692 | return ok, err |
| 693 | } |
| 694 | |
| 695 | if e.shouldNotify() { |
| 696 | var err error |
| 697 | if watcher, ok := e.watcher.(persist.UpdatableWatcher); ok { |
| 698 | err = watcher.UpdateForUpdatePolicy(sec, ptype, oldRule, newRule) |
| 699 | } else { |
| 700 | err = e.watcher.Update() |
| 701 | } |
| 702 | return true, err |
| 703 | } |
| 704 | |
| 705 | return true, nil |
| 706 | } |
| 707 | |
| 708 | func (e *ContextEnforcer) updatePoliciesCtx(ctx context.Context, sec string, ptype string, oldRules [][]string, newRules [][]string) (bool, error) { |
| 709 | ok, err := e.updatePoliciesWithoutNotifyCtx(ctx, sec, ptype, oldRules, newRules) |
no test coverage detected