コード例 #1
0
  @Override
  public List<Menu> findMenuNotInRole(Role role) {
    if (role == null) {
      return new ArrayList<Menu>();
    }

    Role r = findRoleById(role.getId());
    if (r == null || r.getMenuSet().isEmpty()) {
      return new ArrayList<Menu>();
    }

    List<String> ids = new ArrayList<String>();
    for (Menu m : r.getMenuSet()) {
      ids.add(m.getId());
    }

    return menuDao.findByIdNotIn(ids);
  }
コード例 #2
0
  @Override
  public Role findRoleById(String id) {
    if (!StringUtils.hasText(id)) {
      return null;
    }

    Role r = roleDao.findOne(id);
    if (r != null) {
      r.getPermissionSet().size();
      r.getMenuSet().size();
    }

    return r;
  }