Remove all .admin usage

This commit is contained in:
Johannes Zellner
2020-02-24 17:29:20 +01:00
parent 2674160acc
commit 7ce4effc2d
6 changed files with 9 additions and 13 deletions
-4
View File
@@ -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;
+1 -1
View File
@@ -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