code: public boolean hasPermission(final ApiKey apiKey, String permissionName) {
          if (apiKey.getTeams() == null) {
              return false;
          }
          for (final Team team: apiKey.getTeams()) {
              final List<Permission> teamPermissions = getObjectById(Team.class, team.getId()).getPermissions();
              for (final Permission permission: teamPermissions) {
                  if (permission.getName().equals(permissionName)) {
                      return true;
                  }
              }
          }
          return false;
      }
docs: Determines if the specified ApiKey has been assigned the specified permission.
  @param apiKey the ApiKey to query
  @param permissionName the name of the permission
  @return true if the apiKey has the permission assigned, false if not
  @since 1.1.1