Redirect to home when unauthorized user click 'credentials'

This commit is contained in:
AhyoungRyu 2016-07-11 18:31:58 +09:00
parent 5896c12a0a
commit 1d291accdd
2 changed files with 14 additions and 4 deletions

View file

@ -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

View file

@ -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);
});
};