class HealthCheckHelper {

  public static V1SubjectRulesReviewStatus performSecurityChecks(
      KubernetesVersion version, String operatorNamespace, String namespace) {
    String ns = namespace != null ? namespace : operatorNamespace;

    // Validate namespace
    if (DEFAULT_NAMESPACE.equals(operatorNamespace)) {
      LOGGER.fine(MessageKeys.NAMESPACE_IS_DEFAULT);
    }

    // Validate policies allow service account to perform required operations
    AuthorizationProxy ap = new AuthorizationProxy();
    LOGGER.fine(MessageKeys.VERIFY_ACCESS_START, ns);

    V1SelfSubjectRulesReview review = ap.review(ns);
    if (review != null) {
      V1SubjectRulesReviewStatus status = review.getStatus();
      List<V1ResourceRule> rules = status.getResourceRules();

      if (namespace != null) {
        for (Resource r : namespaceAccessChecks.keySet()) {
          for (Operation op : namespaceAccessChecks.get(r)) {
            check(rules, r, op, namespace);
          }
        }
      }
      if (!Main.isDedicated() && operatorNamespace.equals(ns)) {
        for (Resource r : clusterAccessChecks.keySet()) {
          for (Operation op : clusterAccessChecks.get(r)) {
            check(rules, r, op, ns);
          }
        }
      }

      return status;
    }

    return null;
  }

  private  HealthCheckHelper();

}