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

Method AddPolicies

management_api.go:243–245  ·  view source on GitHub ↗

AddPolicies adds authorization rules to the current 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 rule by adding the new rule.

(rules [][]string)

Source from the content-addressed store, hash-verified

241// If the rule already exists, the function returns false for the corresponding rule and the rule will not be added.
242// Otherwise the function returns true for the corresponding rule by adding the new rule.
243func (e *Enforcer) AddPolicies(rules [][]string) (bool, error) {
244 return e.AddNamedPolicies("p", rules)
245}
246
247// AddPoliciesEx adds authorization rules to the current policy.
248// If the rule already exists, the rule will not be added.

Callers 15

TestSetWatcherExFunction · 0.95
BenchmarkHasPolicyMediumFunction · 0.95
BenchmarkHasPolicyLargeFunction · 0.95
BenchmarkAddPolicyMediumFunction · 0.95
BenchmarkAddPolicyLargeFunction · 0.95
BenchmarkRBACModelSizesFunction · 0.95
BenchmarkRBACModelMediumFunction · 0.95
BenchmarkRBACModelLargeFunction · 0.95
TestLinkConditionFuncFunction · 0.95
TestModifyPolicyAPIFunction · 0.95

Calls 1

AddNamedPoliciesMethod · 0.95

Tested by 15

TestSetWatcherExFunction · 0.76
BenchmarkHasPolicyMediumFunction · 0.76
BenchmarkHasPolicyLargeFunction · 0.76
BenchmarkAddPolicyMediumFunction · 0.76
BenchmarkAddPolicyLargeFunction · 0.76
BenchmarkRBACModelSizesFunction · 0.76
BenchmarkRBACModelMediumFunction · 0.76
BenchmarkRBACModelLargeFunction · 0.76
TestLinkConditionFuncFunction · 0.76
TestModifyPolicyAPIFunction · 0.76