derive admin flag from roles
This commit is contained in:
@@ -58,6 +58,13 @@ var ERROR = {
|
||||
UNKNOWN_ERROR: 'Unknown Error' // only used for portin,
|
||||
};
|
||||
|
||||
var ROLES = {
|
||||
OWNER: 'owner',
|
||||
ADMIN: 'admin',
|
||||
USER_MANAGER: 'usermanager',
|
||||
USER: 'user'
|
||||
};
|
||||
|
||||
angular.module('Application').service('Client', ['$http', '$interval', '$timeout', 'md5', 'Notification', function ($http, $interval, $timeout, md5, Notification) {
|
||||
var client = null;
|
||||
|
||||
@@ -326,7 +333,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
this._userInfo.fallbackEmail = userInfo.fallbackEmail;
|
||||
this._userInfo.displayName = userInfo.displayName;
|
||||
this._userInfo.twoFactorAuthenticationEnabled = userInfo.twoFactorAuthenticationEnabled;
|
||||
this._userInfo.admin = userInfo.admin;
|
||||
this._userInfo.admin = userInfo.role === ROLES.OWNER || ROLES.ADMIN;
|
||||
this._userInfo.source = userInfo.source;
|
||||
this._userInfo.avatarUrl = userInfo.avatarUrl + '?s=128&default=mp&ts=' + Date.now(); // we add the timestamp to avoid caching
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user