getLogSessionBean().log(admin, caid, module, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,
getLogSessionBean().log(admin, admin.getCAId(), module, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,
    public boolean isAuthorized(Admin admin, int profileid, String rights, boolean log, int module) throws RemoteException {      Boolean returnval = null;      String resource= null;      String adm = null;            //TODO REMOVE      int caid=0;            if(admin.getAdminInformation().isSpecialUser()){        adm = Integer.toString(admin.getAdminInformation().getSpecialUser());        // Temporary VERY UGLY        return true;      }      else        adm = new String(admin.getAdminInformation().getX509Certificate().getSignature());      resource = adm + AvailableAccessRules.ENDENTITYPROFILEPREFIX+Integer.toString(profileid)+rights;        // Check if name is in hashmap      returnval = (Boolean) profileauthstore.get(resource);      if(returnval != null && log){        if(returnval.booleanValue()){            getLogSessionBean().log(admin, caid, module, new java.util.Date(),null, null, LogEntry.EVENT_INFO_AUTHORIZEDTORESOURCE,                                    "Resource : " + AvailableAccessRules.ENDENTITYPROFILEPREFIX+Integer.toString(profileid)+rights);        }else{            getLogSessionBean().log(admin, caid, module, new java.util.Date(),null, null, LogEntry.EVENT_ERROR_NOTAUTHORIZEDTORESOURCE,                                    "Resource : " + AvailableAccessRules.ENDENTITYPROFILEPREFIX+Integer.toString(profileid)+rights);        }      }      if(returnval==null){        // Retreive profilename over RMI        try{          if(local){            if(log)              authorizationsessionlocal.isAuthorized(admin, AvailableAccessRules.ENDENTITYPROFILEPREFIX+Integer.toString(profileid)+rights);            else              authorizationsessionlocal.isAuthorizedNoLog(admin, AvailableAccessRules.ENDENTITYPROFILEPREFIX+Integer.toString(profileid)+rights);          }else{            if(log)              authorizationsessionremote.isAuthorized(admin, AvailableAccessRules.ENDENTITYPROFILEPREFIX+Integer.toString(profileid)+rights);            else              authorizationsessionremote.isAuthorizedNoLog(admin, AvailableAccessRules.ENDENTITYPROFILEPREFIX+Integer.toString(profileid)+rights);          }          returnval = Boolean.TRUE;        }catch(AuthorizationDeniedException e){          returnval = Boolean.FALSE;        }        profileauthstore.put(resource,returnval);      }      return returnval.booleanValue();    }