예제 #1
0
 @PostConstruct
 public void init() {
   this.importer.setService(service);
   this.listPermissions = securityService.getPermissions();
   this.listUsers = securityService.getUsers();
   this.userLogged = securityService.getUserlogged();
 }
예제 #2
0
  /**
   * Metodo para carga los permisos asociados a ese grupo
   *
   * @return
   */
  public String editGroupPermission() {

    VGroupPermissionExample groupPermissionViewExample = new VGroupPermissionExample();
    com.indizen.cursoSpring.servicio.model.vgrouppermission.VGroupPermissionExample.Criteria
        criteria = groupPermissionViewExample.createCriteria();
    List<java.lang.Integer> list = new ArrayList<java.lang.Integer>();
    list.add(currentEntity.getId());
    criteria.andIdGroupIn(list);
    List<VGroupPermission> listUserIn =
        securityService.getGroupPermissionExample(groupPermissionViewExample);
    targetListPermission = permission(listUserIn);

    HashMap<java.lang.Integer, java.lang.Integer> map =
        new HashMap<java.lang.Integer, java.lang.Integer>();
    for (int i = 0; i < targetListPermission.size(); i++) {
      map.put(
          new java.lang.Integer(targetListPermission.get(i).getId()),
          new java.lang.Integer(targetListPermission.get(i).getId()));
    }

    sourceListPermission = new ArrayList<BeanItem>();
    for (int i = 0; i < listPermissions.size(); i++) {
      if (!map.containsKey(listPermissions.get(i).getId())) {
        sourceListPermission.add(
            new BeanItem(
                listPermissions.get(i).getName(), listPermissions.get(i).getId().toString()));
      }
    }

    dualListModelPermission =
        new DualListModel<BeanItem>(sourceListPermission, targetListPermission);
    generateRandom();
    return null;
  }