From 06a2d4a2aab6a3303b118af49c74eb44ee92fe79 Mon Sep 17 00:00:00 2001 From: Mark Rogers Date: Tue, 22 Jul 2014 15:57:24 +0000 Subject: [PATCH] Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud) 76591: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud) 76521: Merged DEV to V4.2-BUG-FIX 76328 : MNT-11854 : Consumer allowed to create Discussion, Wiki, Blog and Link if she/he creates the first item Add the changes - for discussion, blog and link containers we will get site permission. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@77658 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../scripts/blogs/AbstractBlogWebScript.java | 4 ++-- .../AbstractDiscussionWebScript.java | 4 ++-- .../repo/web/scripts/links/LinksListGet.java | 21 ++----------------- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/source/java/org/alfresco/repo/web/scripts/blogs/AbstractBlogWebScript.java b/source/java/org/alfresco/repo/web/scripts/blogs/AbstractBlogWebScript.java index 6bdb4e2e6c..9f864f1b1c 100644 --- a/source/java/org/alfresco/repo/web/scripts/blogs/AbstractBlogWebScript.java +++ b/source/java/org/alfresco/repo/web/scripts/blogs/AbstractBlogWebScript.java @@ -243,10 +243,10 @@ public abstract class AbstractBlogWebScript extends DeclarativeWebScript } else { - // The NodeRef is the container (if it exists) + // MNT-11854 Consumer allowed to create Discussion, Wiki, Blog and Link if she/he creates the first item if (siteService.hasContainer(siteName, BlogServiceImpl.BLOG_COMPONENT)) { - nodeRef = siteService.getContainer(siteName, BlogServiceImpl.BLOG_COMPONENT); + nodeRef = site.getNodeRef(); } } } diff --git a/source/java/org/alfresco/repo/web/scripts/discussion/AbstractDiscussionWebScript.java b/source/java/org/alfresco/repo/web/scripts/discussion/AbstractDiscussionWebScript.java index 99f181d0cd..73bcdf28a8 100644 --- a/source/java/org/alfresco/repo/web/scripts/discussion/AbstractDiscussionWebScript.java +++ b/source/java/org/alfresco/repo/web/scripts/discussion/AbstractDiscussionWebScript.java @@ -533,10 +533,10 @@ public abstract class AbstractDiscussionWebScript extends DeclarativeWebScript } else { - // The NodeRef is the container (if it exists) + // MNT-11854 Consumer allowed to create Discussion, Wiki, Blog and Link if she/he creates the first item if (siteService.hasContainer(siteName, DiscussionServiceImpl.DISCUSSION_COMPONENT)) { - nodeRef = siteService.getContainer(siteName, DiscussionServiceImpl.DISCUSSION_COMPONENT); + nodeRef = site.getNodeRef(); } } } diff --git a/source/java/org/alfresco/repo/web/scripts/links/LinksListGet.java b/source/java/org/alfresco/repo/web/scripts/links/LinksListGet.java index 5f67eb806d..ffa283f754 100644 --- a/source/java/org/alfresco/repo/web/scripts/links/LinksListGet.java +++ b/source/java/org/alfresco/repo/web/scripts/links/LinksListGet.java @@ -140,25 +140,8 @@ public class LinksListGet extends AbstractLinksWebScript } // We need the container node for permissions checking - NodeRef container; - if (links.getPage().size() > 0) - { - container = links.getPage().get(0).getContainerNodeRef(); - } - else - { - // Find the container (if it's been created yet) - container = siteService.getContainer( - site.getShortName(), LinksServiceImpl.LINKS_COMPONENT); - - if (container == null) - { - // Brand new site, no write operations on links have happened - // Fudge it for now with the site itself, the first write call - // will have the container created - container = site.getNodeRef(); - } - } + // MNT-11854 Consumer allowed to create Discussion, Wiki, Blog and Link if she/he creates the first item + NodeRef container = site.getNodeRef(); // All done Map model = new HashMap();