Skip to content

Commit

Permalink
Redirect to home when unauthorized user click 'credentials'
Browse files Browse the repository at this point in the history
  • Loading branch information
AhyoungRyu committed Jul 11, 2016
1 parent 5896c12 commit 1d291ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions conf/shiro.ini
Expand Up @@ -66,9 +66,9 @@ admin = *
# anon means the access is anonymous.
# authc means Form based Auth Security
# To enfore security, comment the line below and uncomment the next one
# /api/version = anon
# /api/interpreter/** = authc, roles[admin]
# /api/configurations/** = authc, roles[admin]
# /api/credential/** = authc, roles[admin]
/api/version = anon
#/api/interpreter/** = authc, roles[admin]
#/api/configurations/** = authc, roles[admin]
#/api/credential/** = authc, roles[admin]
/** = anon
#/** = authc
10 changes: 10 additions & 0 deletions zeppelin-web/src/app/credential/credential.controller.js
Expand Up @@ -30,6 +30,16 @@ angular.module('zeppelinWebApp').controller('CredentialCtrl', function($scope, $
console.log('Success %o %o', status, $scope.credentialInfo);
}).
error(function(data, status, headers, config) {
if (status === 401) {
ngToast.danger({
content: 'You don\'t have permission on this page',
verticalPosition: 'bottom',
timeout: '3000'
});
setTimeout(function() {
window.location.replace('/');
}, 3000);
}
console.log('Error %o %o', status, data.message);
});
};
Expand Down

0 comments on commit 1d291ac

Please sign in to comment.