code: public boolean checkPermission(String user, List<String> groups, AclAction action) {
      return getPermission(user, groups).contains(action);
    }
docs: Checks whether the user has the permission to perform the action.
  
  1. If the user is the owner, then the owner entry determines the permission;
  2. Else if the user matches the name of one of the named user entries, this entry determines
  the permission;
  3. Else if one of the groups is the owning group and the owning group entry contains the
  requested permission, the permission is granted;
  4. Else if one of the groups matches the name of one of the named group entries and this entry
  contains the requested permission, the permission is granted;
  5. Else if one of the groups is the owning group or matches the name of one of the named group
  entries, but neither the owning group entry nor any of the matching named group entries
  contains the requested permission, the permission is denied;
  6. Otherwise, the other entry determines the permission.
  
  @param user the user
  @param groups the groups the user belongs to
  @param action the action
  @return whether user has the permission to perform the action