From 6168aac2cc6e493c6409092a547c6598ffe8ddf2 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Wed, 26 Jul 2006 11:16:28 +0000 Subject: [PATCH] Merged V1.3 to HEAD (3235:3239, 3240:3246) svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3235 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3239 . svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3240 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3246 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3410 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/repo/copy/CopyServiceImpl.java | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/source/java/org/alfresco/repo/copy/CopyServiceImpl.java b/source/java/org/alfresco/repo/copy/CopyServiceImpl.java index 660847c5fa..f0e1b7be09 100644 --- a/source/java/org/alfresco/repo/copy/CopyServiceImpl.java +++ b/source/java/org/alfresco/repo/copy/CopyServiceImpl.java @@ -444,26 +444,29 @@ public class CopyServiceImpl implements CopyService * @param destinationNodeRef the destination node reference */ private void copyPermissions(NodeRef sourceNodeRef, NodeRef destinationNodeRef) - { - // Get the permission details of the source node reference - Set permissions = this.permissionService.getAllSetPermissions(sourceNodeRef); - boolean includeInherited = this.permissionService.getInheritParentPermissions(sourceNodeRef); - - AccessStatus writePermission = permissionService.hasPermission(destinationNodeRef, PermissionService.CHANGE_PERMISSIONS); - if (this.authenticationService.isCurrentUserTheSystemUser() || writePermission.equals(AccessStatus.ALLOWED)) + { + if(this.permissionService.hasPermission(sourceNodeRef, PermissionService.READ_PERMISSIONS) == AccessStatus.ALLOWED) { - // Set the permission values on the destination node - for (AccessPermission permission : permissions) - { - this.permissionService.setPermission( - destinationNodeRef, - permission.getAuthority(), - permission.getPermission(), - permission.getAccessStatus().equals(AccessStatus.ALLOWED)); - } - this.permissionService.setInheritParentPermissions(destinationNodeRef, includeInherited); + // Get the permission details of the source node reference + Set permissions = this.permissionService.getAllSetPermissions(sourceNodeRef); + boolean includeInherited = this.permissionService.getInheritParentPermissions(sourceNodeRef); + + AccessStatus writePermission = permissionService.hasPermission(destinationNodeRef, PermissionService.CHANGE_PERMISSIONS); + if (writePermission.equals(AccessStatus.ALLOWED) || this.authenticationService.isCurrentUserTheSystemUser() ) + { + // Set the permission values on the destination node + for (AccessPermission permission : permissions) + { + this.permissionService.setPermission( + destinationNodeRef, + permission.getAuthority(), + permission.getPermission(), + permission.getAccessStatus().equals(AccessStatus.ALLOWED)); + } + this.permissionService.setInheritParentPermissions(destinationNodeRef, includeInherited); + } } - } + } /** * Gets the copy details. This calls the appropriate policies that have been registered