Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 36A94186FD for ; Fri, 12 Feb 2016 00:38:40 +0000 (UTC) Received: (qmail 3506 invoked by uid 500); 12 Feb 2016 00:38:40 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 3475 invoked by uid 500); 12 Feb 2016 00:38:40 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 3457 invoked by uid 99); 12 Feb 2016 00:38:39 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Feb 2016 00:38:39 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 0B6432A60A5; Fri, 12 Feb 2016 00:38:38 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============3655289733592917489==" MIME-Version: 1.0 Subject: Review Request 43508: "download zip" does not work From: Keta Patel To: Di Li , Srimanth Gunturi Cc: Keta Patel , Ambari Date: Fri, 12 Feb 2016 00:38:38 -0000 Message-ID: <20160212003838.24150.42223@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Keta Patel X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/43508/ X-Sender: Keta Patel Reply-To: Keta Patel X-ReviewRequest-Repository: ambari --===============3655289733592917489== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/43508/ ----------------------------------------------------------- Review request for Ambari, Di Li and Srimanth Gunturi. Bugs: AMBARI-14932 https://issues.apache.org/jira/browse/AMBARI-14932 Repository: ambari Description ------- Steps to Reproduce: 1. go to "View" - "FILES" - " Create Instance" 2. go to hdfs file view 3. click "download zip" icon The click doesn't download any file. The REST call returns 200 OK status. Detailed steps on configuring Views can be found in the link below: http://docs.hortonworks.com/HDPDocuments/Ambari-2.1.0.0/bk_ambari_views_guide/bk_ambari_views_guide-20150721.pdf Diffs ----- contrib/views/files/src/main/java/org/apache/ambari/view/filebrowser/DownloadService.java 749174a contrib/views/files/src/main/resources/ui/app/controllers/file.js 88fa5fb Diff: https://reviews.apache.org/r/43508/diff/ Testing ------- FIX: The check for "allowed" in the controller, from the response of zipByRequestId() ("/zip" API call for downloading zip file) resulted in no action after clicking the download zip button. This was because there was no "allowed" paramter in the response of zip download. This "allowed" property was added in the response of browse() ("/browse" API call for downloading individual file) to check if the user had permissions for the file or not. This was verified by opening the file. If that operation didn't throw an error, then it would mean that the user had the required permissions to download the individual file. But the fact that the point of execution reaches past the statement of opening the file verifies that the user has the permission. The check with "checkperm" and setting the response with "allowed" attribute in the response is not necessary. So, for the fix I simply removed the check for "allowed" from the controller and also removed the check for "checkperm" which sets the "allowed" attribute in the response. TESTS: There are already exisitng tests for DownloadService, so I haven't added any new ones. Thanks, Keta Patel --===============3655289733592917489==--