GitHub user anthonycorbacho reopened a pull request:

    https://github.com/apache/zeppelin/pull/1567

    [ZEPPELIN-1586] Add security check in NotebookRestApi

    ### What is this PR for?
    
    Bring some security check in `NotebookRestApi`.
    ### What type of PR is it?
    
    [Bug Fix | Improvement | Refactoring]
    ### Todos
    - [x] - Create a proper way to throw webapp error
    - [x] - Add in `NotebookAuthorization` some method to check if user is 
owner, reader or writer
    - [x] - Add Authorization check in `NotebookRestapi` 
    - [x] - Add New test for security in notebook rest api
    
    ### What is the Jira issue?
    - [ZEPPELIN-1586](https://issues.apache.org/jira/browse/ZEPPELIN-1586)
    ### How should this be tested?
    
    First, force Zeppelin to use auth.
    - In `conf/zeppelin-site.xml` change `zeppelin.anonymous.allowed` to 
**false**
      
      ```
      <property>
      <name>zeppelin.anonymous.allowed</name>
      <value>false</value>
      <description>Anonymous user allowed by default</description>
      </property>
      ```
    - In `conf/shiro.ini` set Shiro to use `Auth` at the end of the file
      
      ```
      #/** = anon                                                               
                                                                            
      /** = authc
      ```
    - Start Zeppelin, login and set some permission to a note
    - try to get a note from Zeppelin Rest Api 
`http://localhost:8080/api/notebook/{noteId}` (you can use your browser or curl 
(if you use curl please add shiro token to curl cookie))
    ### Screenshots (if appropriate)
    
    
![note_permission_rest_api](https://cloud.githubusercontent.com/assets/3139557/19827600/ffd68a06-9dea-11e6-8dd5-43f3bd401011.gif)
    ### Questions:
    - Does the licenses files need update? No
    - Is there breaking changes for older versions? No
    - Does this needs documentation? Maybe


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/anthonycorbacho/incubator-zeppelin 
fix/ZEPPELIN-1586

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/1567.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1567
    
----

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to