public Collection<TeamCalDO> getCalendars(final Collection<Integer> calIds) { final Set<TeamCalDO> set = new TreeSet<TeamCalDO>(new TeamCalsComparator()); if (calIds != null) { for (final Integer calId : calIds) { final TeamCalDO cal = getCalendar(calId); if (cal == null) { log.warn("Calendar with id " + calId + " not found in cache."); continue; } if (teamCalRight.hasSelectAccess(ThreadLocalUserContext.getUser()) == true) { set.add(cal); } } } return set; }
/** * Get ordered calendars (by title and id). * * @return All accessible calendars of the context user (as owner or with full, read-only or minimal access). */ public Collection<TeamCalDO> getAllOwnCalendars() { checkRefresh(); final Set<TeamCalDO> set = new TreeSet<TeamCalDO>(new TeamCalsComparator()); final Integer loggedInUserId = ThreadLocalUserContext.getUserId(); for (final TeamCalDO cal : calendarMap.values()) { if (teamCalRight.isOwner(loggedInUserId, cal) == true) { set.add(cal); } } return set; }
/** * Get ordered calendars (by title and id). * * @return All accessible calendars of the context user (as owner or with full, read-only or minimal access). */ public Collection<TeamCalDO> getAllAccessibleCalendars() { checkRefresh(); final Set<TeamCalDO> set = new TreeSet<TeamCalDO>(new TeamCalsComparator()); final PFUserDO loggedInUser = ThreadLocalUserContext.getUser(); for (final TeamCalDO cal : calendarMap.values()) { if (teamCalRight.hasSelectAccess(loggedInUser, cal) == true && cal.isDeleted() == false) { set.add(cal); } } return set; }
/** * Get ordered calendars (by title and id). * * @return All accessible calendars of the context user (as owner or with full, read-only or minimal access). */ public Collection<TeamCalDO> getAllFullAccessCalendars() { checkRefresh(); final Set<TeamCalDO> set = new TreeSet<TeamCalDO>(new TeamCalsComparator()); final PFUserDO loggedInUser = ThreadLocalUserContext.getUser(); for (final TeamCalDO cal : calendarMap.values()) { if (teamCalRight.hasFullAccess(cal, loggedInUser.getId()) == true && cal.isDeleted() == false) { set.add(cal); } } return set; }
calendarsListHelper = new MultiChoiceListHelper<TeamCalDO>().setComparator(new TeamCalsComparator()).setFullList( calendarProvider.getSortedCalenders()); final Collection<Integer> list = getFilter().getTeamCals();