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 139be956cf
commit 13a4308fe9

View File

@@ -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.AuthenticationContext;
import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; 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.TenantAdminService;
import org.alfresco.repo.tenant.TenantService; import org.alfresco.repo.tenant.TenantService;
import org.alfresco.repo.transaction.RetryingTransactionHelper; import org.alfresco.repo.transaction.RetryingTransactionHelper;
@@ -2219,7 +2220,25 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
else else
{ {
// Container is already there // 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 // Ensure the calendar container has the tag scope aspect applied to it
if(! taggingService.isTagScope(container)) if(! taggingService.isTagScope(container))