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

Method UpdatePolicy

management_api.go:290–292  ·  view source on GitHub ↗

UpdatePolicy updates an authorization rule from the current policy.

(oldPolicy []string, newPolicy []string)

Source from the content-addressed store, hash-verified

288
289// UpdatePolicy updates an authorization rule from the current policy.
290func (e *Enforcer) UpdatePolicy(oldPolicy []string, newPolicy []string) (bool, error) {
291 return e.UpdateNamedPolicy("p", oldPolicy, newPolicy)
292}
293
294func (e *Enforcer) UpdateNamedPolicy(ptype string, p1 []string, p2 []string) (bool, error) {
295 return e.updatePolicy("p", ptype, p1, p2)

Callers 2

TestModifyPolicyAPIFunction · 0.95
TestSetWatcherUpdatableFunction · 0.95

Calls 1

UpdateNamedPolicyMethod · 0.95

Tested by 2

TestModifyPolicyAPIFunction · 0.76
TestSetWatcherUpdatableFunction · 0.76