public boolean isAmbariOrClusterAdmin() throws AmbariHttpException {

    if (username == null) return false;

    String url = String.format(AMBARI_OR_CLUSTER_ADMIN, username, name);
    JsonElement response = configurationCache.getUnchecked(url);

    if (response != null && response.isJsonObject()) {
      JsonElement privileges = response.getAsJsonObject().get("privileges");
      if (privileges != null && privileges.isJsonArray()) {
        if (privileges.getAsJsonArray().size() > 0) return true;
      }
    }
    return false;
  }
Get list of services installed on the remote cluster

@return list of services Available on cluster
ambari-server/src/main/java/org/apache/ambari/server/view/RemoteAmbariCluster.java