boolean issuperadministrator= false; try{ issuperadministrator = getAuthorizationSession().isAuthorizedNoLog(admin, "/super_administrator"); }catch(AuthorizationDeniedException ade){}  if(!issuperadministrator && certificateprofile.isApplicableToAnyCA()){  Collection authcas = getAuthorizationSession().getAuthorizedCAIds(admin); certificateprofile.setAvailableCAs(authcas); }
    public void cloneCertificateProfile(Admin admin, String originalcertificateprofilename, String newcertificateprofilename) throws CertificateProfileExistsException{       CertificateProfile certificateprofile = null;              if(isCertificateProfileNameFixed(newcertificateprofilename)){         getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_CERTPROFILE,"Error adding certificaterprofile " + newcertificateprofilename +  " using profile " + originalcertificateprofilename + " as template.");           throw new CertificateProfileExistsException();         }                     try{                  certificateprofile = (CertificateProfile)  getCertificateProfile(admin, originalcertificateprofilename).clone();         try{           certprofilehome.findByCertificateProfileName(newcertificateprofilename);           getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_CERTPROFILE,"Error adding certificaterprofile " + newcertificateprofilename +  " using profile " + originalcertificateprofilename + " as template.");             throw new CertificateProfileExistsException();           }catch(FinderException e){           try{             certprofilehome.create(new Integer(findFreeCertificateProfileId()),newcertificateprofilename,certificateprofile);             getLogSession().log(admin, admin.getCAId(), LogEntry.MODULE_CA, new java.util.Date(),null, null, LogEntry.EVENT_INFO_CERTPROFILE,"New certificateprofile " + newcertificateprofilename +  " used profile " + originalcertificateprofilename + " as template.");           }catch(Exception f){}         }       }catch(CloneNotSupportedException f){}    } // cloneCertificateProfile