diff --git a/src/js/client.js b/src/js/client.js index a6d835c47..7be856c9e 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -336,10 +336,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout this._userInfo.role = userInfo.role; this._userInfo.source = userInfo.source; this._userInfo.avatarUrl = userInfo.avatarUrl + '?s=128&default=mp&ts=' + Date.now(); // we add the timestamp to avoid caching - - // TODO remove this - this._userInfo.admin = userInfo.role === ROLES.OWNER || userInfo.role === ROLES.ADMIN; - this._userInfo.isAtLeastOwner = [ ROLES.OWNER ].indexOf(userInfo.role) !== -1; this._userInfo.isAtLeastAdmin = [ ROLES.OWNER, ROLES.ADMIN ].indexOf(userInfo.role) !== -1; this._userInfo.isAtLeastUserManager = [ ROLES.OWNER, ROLES.ADMIN, ROLES.USER_MANAGER ].indexOf(userInfo.role) !== -1; diff --git a/src/js/main.js b/src/js/main.js index 37a06b396..0e0bb4123 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -31,7 +31,7 @@ angular.module('Application').controller('MainController', ['$scope', '$route', // NOTE: this function is exported and called from the appstore.js $scope.updateSubscriptionStatus = function () { - if (!Client.getUserInfo().admin) return; + if (!Client.getUserInfo().isAtLeastAdmin) return; Client.getSubscription(function (error, subscription) { if (error && error.statusCode === 412) return; // ignore if not yet registered diff --git a/src/views/apps.js b/src/views/apps.js index 61653a571..a09db534f 100644 --- a/src/views/apps.js +++ b/src/views/apps.js @@ -66,7 +66,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$timeout' $interval.cancel(refreshAppsTimer); }); - if (!$scope.user.admin) return; + if (!$scope.user.isAtLeastAdmin) return; Client.getDomains(function (error, result) { if (error) Client.error(error); diff --git a/src/views/appstore.html b/src/views/appstore.html index e1d329158..11dbeb527 100644 --- a/src/views/appstore.html +++ b/src/views/appstore.html @@ -57,17 +57,17 @@ -
+

This app has it's own user management.

-
+

All users with a mailbox on this Cloudron have access.

-
+