mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9156 Calendar listing permissions check unit tests
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29025 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -120,6 +120,24 @@ public class CalendarServiceImpl implements CalendarService
|
||||
*/
|
||||
protected NodeRef getSiteCalendarContainer(final String siteShortName, boolean create)
|
||||
{
|
||||
// Does the site exist?
|
||||
if(siteService.getSite(siteShortName) == null) {
|
||||
// Either the site doesn't exist, or you're not allowed to see it
|
||||
if(! create)
|
||||
{
|
||||
// Just say there's no container
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We can't create on a non-existant site
|
||||
throw new AlfrescoRuntimeException(
|
||||
"Unable to create the calendar container from a hidden or non-existant site"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Check about the container
|
||||
if(! siteService.hasContainer(siteShortName, CALENDAR_COMPONENT))
|
||||
{
|
||||
if(create)
|
||||
@@ -405,12 +423,6 @@ public class CalendarServiceImpl implements CalendarService
|
||||
List<NodeRef> containersL = new ArrayList<NodeRef>();
|
||||
for(String siteShortName : siteShortNames)
|
||||
{
|
||||
// Ensure the site exists, skip if not
|
||||
if(siteService.getSite(siteShortName) == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Grab the container for this site
|
||||
NodeRef container = getSiteCalendarContainer(siteShortName, false);
|
||||
if(container != null)
|
||||
|
Reference in New Issue
Block a user