boolean allexists = false;
    private boolean authorizedToProfile(HardTokenProfile profile, boolean editcheck){      boolean returnval = false;        boolean allexists = false;        try{                  try{          authorizationsession.isAuthorizedNoLog(administrator, "/super_administrator");          return true;          }catch(AuthorizationDeniedException ade){}                if(editcheck)                  authorizationsession.isAuthorizedNoLog(administrator, "/hardtoken_functionality/edit_hardtoken_profiles");                    	      HashSet authorizedcertprofiles = new HashSet(certificatesession.getAuthorizedCertificateProfileIds(administrator, CertificateDataBean.CERTTYPE_HARDTOKEN));	  	   	          		  		  if(profile instanceof EIDProfile){		  			  	if(authorizedcertprofiles.containsAll(((EIDProfile) profile).getAllCertificateProfileIds())){		  	  returnval = true;			  	   		  	}		  			  }else{		  	//Implement for other profile types		  }		   		  	   	  	                }catch(AuthorizationDeniedException e){}                return returnval;      }    