Exemplo n.º 1
0
  protected void checkMembershipValidity(RequestContext context) {

    VOMSUser u = context.getVOMSUser();
    VOMSRequest r = context.getRequest();

    if (u.isSuspended()) {
      failResponse(
          context,
          VOMSErrorMessage.suspendedUser(
              r.getHolderSubject(), r.getHolderIssuer(), u.getSuspensionReason()));
      context.setHandled(true);
      return;
    }

    Certificate cert = u.getCertificate(r.getHolderSubject(), r.getHolderIssuer());

    if (cert.isSuspended()) {
      failResponse(
          context,
          VOMSErrorMessage.suspendedCertificate(
              cert.getSubjectString(),
              cert.getCa().getSubjectString(),
              cert.getSuspensionReason()));
    }
  }
  @Action("delete-certificate")
  public String deleteCertificate() throws Exception {

    Certificate cert = CertificateDAO.instance().findById(getCertificateId());

    // FIXME: create constructor that accepts a certificate
    RemoveUserCertificateOperation.instance(
            cert.getSubjectString(), cert.getCa().getSubjectString())
        .execute();

    return SUCCESS;
  }