From 5880ca077e09f6496ffabe61c223ee102c7a90eb Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 25 Aug 2011 13:36:57 +0000 Subject: [PATCH] ALF-8670 When listing events in a site you have permissions to, but where you lack permissions to the calendar container, return no events rather than an exception. (This is the behaviour if you can see the container, but not the event nodes inside it) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30059 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../calendar/UserCalendarEntriesGet.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/source/java/org/alfresco/repo/web/scripts/calendar/UserCalendarEntriesGet.java b/source/java/org/alfresco/repo/web/scripts/calendar/UserCalendarEntriesGet.java index 62f5dc0bfa..1366f3ff76 100644 --- a/source/java/org/alfresco/repo/web/scripts/calendar/UserCalendarEntriesGet.java +++ b/source/java/org/alfresco/repo/web/scripts/calendar/UserCalendarEntriesGet.java @@ -31,6 +31,7 @@ import org.alfresco.query.PagingRequest; import org.alfresco.query.PagingResults; import org.alfresco.repo.calendar.CalendarServiceImpl; import org.alfresco.repo.security.authentication.AuthenticationUtil; +import org.alfresco.repo.security.permissions.AccessDeniedException; import org.alfresco.service.cmr.calendar.CalendarEntry; import org.alfresco.service.cmr.calendar.CalendarEntryDTO; import org.alfresco.service.cmr.calendar.CalendarRecurrenceHelper; @@ -132,10 +133,19 @@ public class UserCalendarEntriesGet extends AbstractCalendarWebScript { SiteInfo site = sites.get(i); siteShortNames[i] = site.getShortName(); - containerLookup.put( - siteService.getContainer(site.getShortName(), CalendarServiceImpl.CALENDAR_COMPONENT), - site - ); + + try + { + containerLookup.put( + siteService.getContainer(site.getShortName(), CalendarServiceImpl.CALENDAR_COMPONENT), + site + ); + } + catch(AccessDeniedException e) + { + // You can see the site, but not the calendar, so skip it + // This means you won't have any events in it anyway + } }