if(profile != null){
if(profile == null && editcheck){ authorizationsession.isAuthorizedNoLog(administrator, "/super_administrator"); } if(profile == null){ returnval = true; }else{
    private boolean authorizedToProfile(EndEntityProfile profile, boolean editcheck){      boolean returnval = false;        boolean allexists = false;        try{          if(editcheck)            authorizationsession.isAuthorizedNoLog(administrator, "/ra_functionality/edit_end_entity_profiles");                HashSet authorizedcaids = new HashSet(authorizationsession.getAuthorizedCAIds(administrator));               if(profile != null){          String availablecasstring = profile.getValue(EndEntityProfile.AVAILCAS, 0);             if(availablecasstring == null || availablecasstring.equals("")){            allexists = true;            }else{            String[] availablecas = profile.getValue(EndEntityProfile.AVAILCAS, 0).split(EndEntityProfile.SPLITCHAR);            allexists = true;            for(int j=0; j < availablecas.length; j++){              if(!authorizedcaids.contains( new Integer(availablecas[j]))){                allexists = false;              }            }          }            returnval = allexists;                  }      }catch(AuthorizationDeniedException e){}               return returnval;      }