Merged 5.0.N (5.0.3) to HEAD (5.1)

109438: Merged V4.2-BUG-FIX (4.2.6) to 5.0.N (5.0.3)
      109264: Merged V4.2.5 (4.2.5) to V4.2-BUG-FIX (4.2.6)
         109214: Merged DEV to V4.2.5-PATCHES
            109105: MNT-14452: Permissions not amended correctly when changing a site from private to public
              - Return inheritance to the site containers when site becomes public.  
            109213: MNT-14452: Permissions not amended correctly when changing a site from private to public
              - Unit test for change visibility


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@109800 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-08-08 07:59:52 +00:00
parent 644ef74c65
commit 009d4ff6d1
2 changed files with 46 additions and 3 deletions

View File

@@ -1530,10 +1530,10 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
}
}
// If the site was moderated before, undo the work of #setModeratedPermissions
// If the site was moderated/private before, undo the work of #setModeratedPermissions/#setPrivatePermissions
// by restoring inherited permissions on the containers
// (Leaving the old extra permissions on containers is fine)
if (SiteVisibility.MODERATED.equals(currentVisibility) == true)
if (SiteVisibility.MODERATED.equals(currentVisibility) == true || SiteVisibility.PRIVATE.equals(currentVisibility) == true)
{
List<FileInfo> folders = fileFolderService.listFolders(siteNodeRef);
for(FileInfo folder : folders)
@@ -1563,7 +1563,13 @@ public class SiteServiceImpl extends AbstractLifecycleBean implements SiteServic
}
else if (SiteVisibility.PRIVATE.equals(updatedVisibility))
{
// No additional permissions need to be granted for a site become private
// Set the private permissions on all the containers the site already has
List<FileInfo> folders = fileFolderService.listFolders(siteNodeRef);
for(FileInfo folder : folders)
{
NodeRef containerNodeRef = folder.getNodeRef();
setPrivatePermissions(shortName, containerNodeRef);
}
}
// Update the site node reference with the updated visibility value