Skip to content

Commit

Permalink
[ZEPPELIN-1868]fix to not shows up the login button on Anonymous mode.
Browse files Browse the repository at this point in the history
### 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 <hsshim@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.
  • Loading branch information
astroshim authored and AhyoungRyu committed Jan 8, 2017
1 parent 0f65714 commit b7ffb06
Showing 1 changed file with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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') {
Expand Down

0 comments on commit b7ffb06

Please sign in to comment.