Exemple #1
0
  public void postRead(AcUser e) {
    String login = e.getLogin();

    // roles
    for (AcUserRole ur : getUserRoles(login)) {
      String code = ur.getRole();
      AcRoleEnum r = AcRoleEnum.getFromCode(code);
      if (r == null) e.addRoleGroup(getRoleGroup(code));
      else e.addRole(r);
    }

    // airports
    for (AcUserAirport ua : getAirports(login)) {
      e.getAirportCodes().add(ua.getAirportCode());
    }

    // configurable modules
    if (e.hasMyGlobalModuleConfigId()) {
      AcMenu m = getAccess().getModuleConfigDb().getFullMenu(e.getMyGlobalModuleConfigId());
      e.setMyGlobalMenu(m);
    }
    if (e.hasMyStationModuleConfigId()) {
      AcMenu m = getAccess().getModuleConfigDb().getFullMenu(e.getMyStationModuleConfigId());
      e.setMyStationMenu(m);
    }
  }
Exemple #2
0
 public void update(AcUser e) {
   super.update(e);
   getAccess().getUserRoleDb().updateRolesFor(e);
   getAccess().getUserAirportDb().updateAirportsFor(e);
   getAccess()
       .getUserAirportMobileDeviceCacheDb()
       .insertFromUserAirportWithLogin(e.getLogin(), AcGlobals.nowUtc());
 }