Repository: zeppelin
Updated Branches:
  refs/heads/master 0f6571452 -> b7ffb0693


[ZEPPELIN-1868]fix to not shows up the login button on Anonymous mode.

### What is this PR for?
This PR fixs to not shows up the login button on Anonymous mode.

### What type of PR is it?
Bug Fix

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1868

### How should this be tested?
1. Give permission on note.
2. Turn off the shiro.
3. Delete note that you made on 1.
4. Then you can see the `login button` like as screen shot.

### Screenshots (if appropriate)
![image](https://cloud.githubusercontent.com/assets/3348133/21537257/89d15862-cd43-11e6-8129-0e25348537ae.png)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: astroshim <hss...@zepl.com>

Closes #1813 from astroshim/feat/skipLogin and squashes the following commits:

ba72188 [astroshim] fix to not shows up the login button on Anonymous mode.


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/b7ffb069
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/b7ffb069
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/b7ffb069

Branch: refs/heads/master
Commit: b7ffb06931acfa0711033e65050e56d11800a3f1
Parents: 0f65714
Author: astroshim <hss...@zepl.com>
Authored: Wed Dec 28 21:12:43 2016 -0800
Committer: ahyoungryu <ahyoung...@apache.org>
Committed: Sun Jan 8 14:38:59 2017 +0900

----------------------------------------------------------------------
 .../websocketEvents/websocketEvents.factory.js  | 29 ++++++++++++++------
 1 file changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/b7ffb069/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
----------------------------------------------------------------------
diff --git 
a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js 
b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
index ebcaf9a..c3e0334 100644
--- a/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
+++ b/zeppelin-web/src/components/websocketEvents/websocketEvents.factory.js
@@ -69,13 +69,16 @@
       } else if (op === 'LIST_UPDATE_NOTE_JOBS') {
         $rootScope.$broadcast('setUpdateNoteJobs', data.noteRunningJobs);
       } else if (op === 'AUTH_INFO') {
-        BootstrapDialog.show({
-          closable: false,
-          closeByBackdrop: false,
-          closeByKeyboard: false,
-          title: 'Insufficient privileges',
-          message: data.info.toString(),
-          buttons: [{
+        var btn = [];
+        if ($rootScope.ticket.roles === '[]') {
+          btn = [{
+            label: 'Close',
+            action: function(dialog) {
+              dialog.close();
+            }
+          }];
+        } else {
+          btn = [{
             label: 'Login',
             action: function(dialog) {
               dialog.close();
@@ -89,8 +92,18 @@
               dialog.close();
               $location.path('/');
             }
-          }]
+          }];
+        }
+
+        BootstrapDialog.show({
+          closable: false,
+          closeByBackdrop: false,
+          closeByKeyboard: false,
+          title: 'Insufficient privileges',
+          message: data.info.toString(),
+          buttons: btn
         });
+
       } else if (op === 'PARAGRAPH') {
         $rootScope.$broadcast('updateParagraph', data);
       } else if (op === 'PARAGRAPH_APPEND_OUTPUT') {

Reply via email to