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

Method AddNamedGroupingPolicies

management_api.go:411–413  ·  view source on GitHub ↗

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

(ptype string, rules [][]string)

Source from the content-addressed store, hash-verified

409// If the rule already exists, the function returns false for the corresponding policy rule and the rule will not be added.
410// Otherwise the function returns true for the corresponding policy rule by adding the new rule.
411func (e *Enforcer) AddNamedGroupingPolicies(ptype string, rules [][]string) (bool, error) {
412 return e.addPolicies("g", ptype, rules, false)
413}
414
415// AddNamedGroupingPoliciesEx adds named role inheritance rules to the current policy.
416// If the rule already exists, the rule will not be added.

Callers 2

AddGroupingPoliciesMethod · 0.95

Calls 1

addPoliciesMethod · 0.95

Tested by 1