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

Method AddPolicies

enforcer_synced.go:377–381  ·  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

375// If the rule already exists, the function returns false for the corresponding rule and the rule will not be added.
376// Otherwise the function returns true for the corresponding rule by adding the new rule.
377func (e *SyncedEnforcer) AddPolicies(rules [][]string) (bool, error) {
378 e.m.Lock()
379 defer e.m.Unlock()
380 return e.Enforcer.AddPolicies(rules)
381}
382
383// AddPoliciesEx adds authorization rules to the current policy.
384// If the rule already exists, the rule will not be added.

Callers

nothing calls this directly

Calls 1

AddPoliciesMethod · 0.65

Tested by

no test coverage detected