Add feature object and show/hide elements accordingly

This commit is contained in:
Johannes Zellner
2020-02-13 15:30:31 +01:00
parent 3dd0566f48
commit a13414ddb9
7 changed files with 135 additions and 98 deletions

View File

@@ -218,6 +218,14 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
region: null,
size: null
};
this._features = {
userMaxCount: Infinity,
appMaxCount: 2, // unused checked on the appstore side, but just for completeness
externalLdap: true,
eventLog: true,
privateDockerRegistry: true,
branding: true
};
this._installedApps = [];
this._installedAppsById = {};
this._appTags = [];
@@ -365,6 +373,10 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
return this._config;
};
Client.prototype.getFeatures = function () {
return this._features;
};
Client.prototype.setToken = function (accessToken) {
if (!accessToken) localStorage.removeItem('token');
else localStorage.token = accessToken;