From e71555b70b83dae3d35e5da115fefa0aaa7ccb79 Mon Sep 17 00:00:00 2001 From: xingpeng1 Date: Sat, 3 Feb 2018 11:14:23 +0800 Subject: [PATCH 1/1] KYLIN-3199 The login dialog should be closed when ldap user with no permission login correctly --- webapp/app/js/services/users.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/webapp/app/js/services/users.js b/webapp/app/js/services/users.js index 55c1508..bccd414 100644 --- a/webapp/app/js/services/users.js +++ b/webapp/app/js/services/users.js @@ -17,11 +17,6 @@ */ KylinApp.service('UserService', function ($http, $q) { - var roles = { - 'ROLE_MODELER': '/models', - 'ROLE_ANALYST': '/models', - 'ROLE_ADMIN': '/models' - }; var curUser = {}; this.getCurUser = function () { @@ -46,14 +41,6 @@ KylinApp.service('UserService', function ($http, $q) { return curUser.userDetails && curUser.userDetails.authorities && curUser.userDetails.authorities.length > 0; }; this.getHomePage = function () { - var homePage = "/login"; - - if (curUser.userDetails && curUser.userDetails.authorities) { - angular.forEach(curUser.userDetails.authorities, function (authority, index) { - homePage = (!!roles[authority.authority]) ? roles[authority.authority] : homePage; - }); - } - - return homePage; + return this.isAuthorized()? "/models" : "/login"; } }); -- 2.7.2.windows.1