RemoveNamedGroupingPolicy removes a role inheritance rule from the current named policy.
(ptype string, params ...interface{})
| 436 | |
| 437 | // RemoveNamedGroupingPolicy removes a role inheritance rule from the current named policy. |
| 438 | func (e *Enforcer) RemoveNamedGroupingPolicy(ptype string, params ...interface{}) (bool, error) { |
| 439 | var ruleRemoved bool |
| 440 | var err error |
| 441 | if strSlice, ok := params[0].([]string); len(params) == 1 && ok { |
| 442 | ruleRemoved, err = e.removePolicy("g", ptype, strSlice) |
| 443 | } else { |
| 444 | policy := make([]string, 0) |
| 445 | for _, param := range params { |
| 446 | policy = append(policy, param.(string)) |
| 447 | } |
| 448 | |
| 449 | ruleRemoved, err = e.removePolicy("g", ptype, policy) |
| 450 | } |
| 451 | |
| 452 | return ruleRemoved, err |
| 453 | } |
| 454 | |
| 455 | // RemoveNamedGroupingPolicies removes role inheritance rules from the current named policy. |
| 456 | func (e *Enforcer) RemoveNamedGroupingPolicies(ptype string, rules [][]string) (bool, error) { |