Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

83943: Merged V4.2-BUG-FIX (4.2.4) to HEAD-BUG-FIX (5.0/Cloud)
      82504: Merged V4.1-BUG-FIX (4.1.10) to V4.2-BUG-FIX (4.2.4)
         81668: Merged DEV to V4.1-BUG-FIX (4.1.10)
            80985 : MNT-12082 : Consumers can add comments using URL parameters, although they are not allowed to do so
               - Fixed the issue. Implemented a test to simulate the issue.
      82513: Fix build failure after:
         Merged DEV to V4.1-BUG-FIX (4.1.10)
            80985 : MNT-12082 : Consumers can add comments using URL parameters, although they are not allowed to do so
               - Fixed the issue. Implemented a test to simulate the issue.
      83418: Add further hacks to the CommentsApiTest, which needs to be refactored to use RetryingTransactionHelper.
      83679: MNT-12082 : Consumers can add comments using URL parameters, although they are not allowed to do so
         - Fixed build failure


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@84601 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-09-18 17:17:42 +00:00
parent aab50bd113
commit 17b9a6daf5

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
* Copyright (C) 2005-2014 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -254,7 +254,13 @@ public class BlogServiceImpl implements BlogService
{
// Comment from the old JavaScript:
// disable permission inheritance. The result is that only the creator will have access to the draft
permissionService.setInheritParentPermissions(postNode.getChildRef(), false);
NodeRef draft = postNode.getChildRef();
permissionService.setInheritParentPermissions(draft, false);
// MNT-12082: give permissions to the post creator. He should be able to comment in his post's
// forumFolder and commentsFolder, where owner is System user
String creator = (String) nodeService.getProperty(draft, ContentModel.PROP_CREATOR);
permissionService.setPermission(draft, creator, permissionService.getAllPermission(), true);
}
else
{
@@ -474,6 +480,10 @@ public class BlogServiceImpl implements BlogService
// this
if (!permissionService.getInheritParentPermissions(blogPostNode))
{
// MNT-12082
String creator = (String) nodeService.getProperty(blogPostNode, ContentModel.PROP_CREATOR);
permissionService.deletePermission(blogPostNode, creator, permissionService.getAllPermission());
permissionService.setInheritParentPermissions(blogPostNode, true);
}