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
This commit is contained in:
Nick Burch
2011-08-25 13:36:57 +00:00
parent af122ab838
commit 5880ca077e

View File

@@ -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
}
}