hasRequiredAccess checks if any group in the passed in groups is allowed to perform the operation according to the acl rules stored in groupPerms
(groupPerms map[string]int32, groups []string, operation *acl.Operation)
| 199 | // hasRequiredAccess checks if any group in the passed in groups is allowed to perform the operation |
| 200 | // according to the acl rules stored in groupPerms |
| 201 | func hasRequiredAccess(groupPerms map[string]int32, groups []string, |
| 202 | operation *acl.Operation) bool { |
| 203 | for _, group := range groups { |
| 204 | groupPerm, found := groupPerms[group] |
| 205 | if found && (groupPerm&operation.Code != 0) { |
| 206 | return true |
| 207 | } |
| 208 | } |
| 209 | return false |
| 210 | } |