AddPolicy adds an authorization rule to the current policy. If the rule already exists, the function returns false and the rule will not be added. Otherwise the function returns true by adding the new rule.
(params ...interface{})
| 234 | // If the rule already exists, the function returns false and the rule will not be added. |
| 235 | // Otherwise the function returns true by adding the new rule. |
| 236 | func (e *Enforcer) AddPolicy(params ...interface{}) (bool, error) { |
| 237 | return e.AddNamedPolicy("p", params...) |
| 238 | } |
| 239 | |
| 240 | // AddPolicies adds authorization rules to the current policy. |
| 241 | // If the rule already exists, the function returns false for the corresponding rule and the rule will not be added. |