BatchEnforceWithMatcher enforce with matcher in batches.
(matcher string, requests [][]interface{})
| 962 | |
| 963 | // BatchEnforceWithMatcher enforce with matcher in batches. |
| 964 | func (e *Enforcer) BatchEnforceWithMatcher(matcher string, requests [][]interface{}) ([]bool, error) { |
| 965 | var results []bool |
| 966 | for _, request := range requests { |
| 967 | result, err := e.enforce(matcher, nil, request...) |
| 968 | if err != nil { |
| 969 | return results, err |
| 970 | } |
| 971 | results = append(results, result) |
| 972 | } |
| 973 | return results, nil |
| 974 | } |
| 975 | |
| 976 | // AddNamedMatchingFunc add MatchingFunc by ptype RoleManager. |
| 977 | func (e *Enforcer) AddNamedMatchingFunc(ptype, name string, fn rbac.MatchingFunc) bool { |