@Override public long getProjectListNum(User user) { if (user != null && user.isUserInRole("admin")) { user = null; } return projectDao.getProjectListNum(user); }
@Override public List<Project> getProjectList(User user, int curPageNum, int pageSize) { List<Project> projectList = projectDao.getProjectList(user, curPageNum, pageSize); for (Project p : projectList) { if (user.isUserInRole("admin") || p.getUser().getId() == user.getId()) p.setIsManagable(true); } return projectList; }