use of com.liferay.calendar.model.CalendarResource in project liferay-ide by liferay.
the class CalendarPortlet method addCalendar.
protected void addCalendar(PortletRequest portletRequest, Set<Calendar> calendarsSet, long classNameId, long classPK) throws PortalException, SystemException {
CalendarResource calendarResource = CalendarResourceUtil.getCalendarResource(portletRequest, classNameId, classPK);
if (calendarResource == null) {
return;
}
ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);
PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();
List<Calendar> calendars = CalendarLocalServiceUtil.getCalendarResourceCalendars(calendarResource.getGroupId(), calendarResource.getCalendarResourceId());
for (Calendar calendar : calendars) {
if (!CalendarPermission.contains(permissionChecker, calendar, ActionKeys.VIEW)) {
continue;
}
calendarsSet.add(calendar);
}
}
Aggregations