From 9876257ae99762fe1dce93e03e09980883344e26 2016-11-09 17:44:10 From: Marcin Lulek Date: 2016-11-09 17:44:10 Subject: [PATCH] permissions: dont fail if permissions are unset --- diff --git a/backend/src/appenlight/static/js/appenlight.js b/backend/src/appenlight/static/js/appenlight.js index f7ee5dd..e2870e1 100644 --- a/backend/src/appenlight/static/js/appenlight.js +++ b/backend/src/appenlight/static/js/appenlight.js @@ -13092,6 +13092,9 @@ angular.module('appenlight.services.stateHolder', []).factory('stateHolder', }; AeUser.hasAppPermission = function (perm_name) { + if (!this.permissions){ + return false + } if (this.permissions.indexOf('root_administration') !== -1) { return true } diff --git a/frontend/src/services/state_holder.js b/frontend/src/services/state_holder.js index db7c3f2..a4e9628 100644 --- a/frontend/src/services/state_holder.js +++ b/frontend/src/services/state_holder.js @@ -63,6 +63,9 @@ angular.module('appenlight.services.stateHolder', []).factory('stateHolder', }; AeUser.hasAppPermission = function (perm_name) { + if (!this.permissions){ + return false + } if (this.permissions.indexOf('root_administration') !== -1) { return true }