boolean allexists = false;
    private boolean authorizedToProfile(CertificateProfile profile, boolean editcheck){      boolean returnval = false;        boolean allexists = false;        try{          boolean issuperadministrator = false;        try{          issuperadministrator = authorizationsession.isAuthorizedNoLog(administrator, "/super_administrator");          }catch(AuthorizationDeniedException ade){}                if(editcheck)                  authorizationsession.isAuthorizedNoLog(administrator, "/ca_functionality/edit_certificate_profiles");                  HashSet authorizedcaids = new HashSet(authorizationsession.getAuthorizedCAIds(administrator));               if(profile != null){       	      if(!issuperadministrator && profile.getType() != CertificateProfile.TYPE_ENDENTITY)	        returnval = false;	      else{          		                  Collection availablecas = profile.getAvailableCAs();            if(availablecas.contains(new Integer(CertificateProfile.ANYCA))){              if(issuperadministrator && editcheck)                returnval = true;                if(!editcheck)                returnval = true;              }else              returnval = authorizedcaids.containsAll(availablecas);	      }                                   }      }catch(AuthorizationDeniedException e){}               return returnval;      }    