[ 
https://issues.apache.org/jira/browse/AMBARI-14932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15137934#comment-15137934
 ] 

Keta Patel commented on AMBARI-14932:
-------------------------------------

Hello Dipayan,
Thank you for the prompt response. I understood your reasoning in the last 
comment. I, however, have a few more questions to understand this issue:

>From your explanation for (Q3), I understand that the 1st server call with 
>"checkperm" ensures that the user has the permission to open the file. If he 
>does not have the permission, then a "ServiceFormattedException" error is 
>thrown (This is seen in image attached "error_after_file_open.tiff"). This 
>error is caught in the controller and and alert is displayed on the screen.
If the user has the permission, then you get a response with "allowed=true" in 
the response and you make a 2nd server call. This time, the response is to 
download the file.

My question:
Q4)
In case of the user NOT having permission, the statement checking "checkperm" 
parameter is not even reached. The error thrown is directly caught in the 
controller code. It is only in the success case (i.e. the user has the 
permissions for the file), the statement checking "checkperm" is reached. 
Couldn't we directly execute the code to download the file if the execution 
reaches past the statement of "FSDataInputStream fs = api.open(path);" (i.e. 
the place where we check "checkperm" at present) ?
This would save the 2nd server call. If the user has permission, the file is 
downloaded, otherwise and alert is displayed.

Please correct me if I am wrong in my understanding.
Thank you

> "download zip"  does not work
> -----------------------------
>
>                 Key: AMBARI-14932
>                 URL: https://issues.apache.org/jira/browse/AMBARI-14932
>             Project: Ambari
>          Issue Type: Bug
>          Components: ambari-views, contrib
>    Affects Versions: trunk
>            Reporter: Keta Patel
>            Assignee: Keta Patel
>         Attachments: DownloadService.tiff, adapter.tiff, 
> error_after_file_open.tiff, file_1.tiff, file_2.tiff, screenshot.tiff
>
>
> 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



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to