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
This commit is contained in:
Derek Hulley
2006-07-26 11:16:28 +00:00
parent a39720a3ff
commit 6168aac2cc

View File

@@ -444,26 +444,29 @@ public class CopyServiceImpl implements CopyService
* @param destinationNodeRef the destination node reference * @param destinationNodeRef the destination node reference
*/ */
private void copyPermissions(NodeRef sourceNodeRef, NodeRef destinationNodeRef) private void copyPermissions(NodeRef sourceNodeRef, NodeRef destinationNodeRef)
{ {
// Get the permission details of the source node reference if(this.permissionService.hasPermission(sourceNodeRef, PermissionService.READ_PERMISSIONS) == AccessStatus.ALLOWED)
Set<AccessPermission> 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))
{ {
// Set the permission values on the destination node // Get the permission details of the source node reference
for (AccessPermission permission : permissions) Set<AccessPermission> permissions = this.permissionService.getAllSetPermissions(sourceNodeRef);
{ boolean includeInherited = this.permissionService.getInheritParentPermissions(sourceNodeRef);
this.permissionService.setPermission(
destinationNodeRef, AccessStatus writePermission = permissionService.hasPermission(destinationNodeRef, PermissionService.CHANGE_PERMISSIONS);
permission.getAuthority(), if (writePermission.equals(AccessStatus.ALLOWED) || this.authenticationService.isCurrentUserTheSystemUser() )
permission.getPermission(), {
permission.getAccessStatus().equals(AccessStatus.ALLOWED)); // Set the permission values on the destination node
} for (AccessPermission permission : permissions)
this.permissionService.setInheritParentPermissions(destinationNodeRef, includeInherited); {
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 * Gets the copy details. This calls the appropriate policies that have been registered