From 13a4308fe90bba81232b3a91973b5f55daae3293 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 --- .../alfresco/repo/site/SiteServiceImpl.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/repo/site/SiteServiceImpl.java b/source/java/org/alfresco/repo/site/SiteServiceImpl.java index 639578ed8f..8deda3c049 100644 --- a/source/java/org/alfresco/repo/site/SiteServiceImpl.java +++ b/source/java/org/alfresco/repo/site/SiteServiceImpl.java @@ -55,6 +55,7 @@ import org.alfresco.repo.search.impl.lucene.AbstractLuceneQueryParser; import org.alfresco.repo.security.authentication.AuthenticationContext; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; +import org.alfresco.repo.security.permissions.AccessDeniedException; import org.alfresco.repo.tenant.TenantAdminService; import org.alfresco.repo.tenant.TenantService; import org.alfresco.repo.transaction.RetryingTransactionHelper; @@ -2219,7 +2220,25 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic else { // Container is already there - final NodeRef container = siteService.getContainer(siteShortName, componentName); + NodeRef containerTmp = null; + try + { + containerTmp = siteService.getContainer(siteShortName, componentName); + } + catch(AccessDeniedException e) + { + if(!create) + { + // Just pretend it isn't there, as they can't see it + return null; + } + else + { + // It's there, they can't see it, and they need it + throw e; + } + } + final NodeRef container = containerTmp; // Ensure the calendar container has the tag scope aspect applied to it if(! taggingService.isTagScope(container))