MCPcopy
hub / github.com/apache/casbin / AddNamedPolicies

Method AddNamedPolicies

management_api.go:273–275  ·  view source on GitHub ↗

AddNamedPolicies adds authorization rules to the current named policy. If the rule already exists, the function returns false for the corresponding rule and the rule will not be added. Otherwise the function returns true for the corresponding by adding the new rule.

(ptype string, rules [][]string)

Source from the content-addressed store, hash-verified

271// If the rule already exists, the function returns false for the corresponding rule and the rule will not be added.
272// Otherwise the function returns true for the corresponding by adding the new rule.
273func (e *Enforcer) AddNamedPolicies(ptype string, rules [][]string) (bool, error) {
274 return e.addPolicies("p", ptype, rules, false)
275}
276
277// AddNamedPoliciesEx adds authorization rules to the current named policy.
278// If the rule already exists, the rule will not be added.

Callers 1

AddPoliciesMethod · 0.95

Calls 1

addPoliciesMethod · 0.95

Tested by

no test coverage detected