diff --git a/src/js/client.js b/src/js/client.js index 7be856c9e..db079d810 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -355,7 +355,7 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout <% } -%> // => This is just for easier testing - // this._config.features.userMaxCount = 3; + // this._config.features.userMaxCount = 5; // this._config.features.externalLdap = false; // this._config.features.eventLog = false; // this._config.features.privateDockerRegistry = false; diff --git a/src/views/users.html b/src/views/users.html index 4ae1b616e..5b023389b 100644 --- a/src/views/users.html +++ b/src/views/users.html @@ -44,10 +44,10 @@ -
+
- +
@@ -128,10 +128,10 @@
-
+
- +
diff --git a/src/views/users.js b/src/views/users.js index b38733779..7fb3730ee 100644 --- a/src/views/users.js +++ b/src/views/users.js @@ -26,10 +26,10 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio $scope.userInfo = Client.getUserInfo(); $scope.roles = [ - { id: 'user', name: 'User' }, - { id: 'usermanager', name: 'User Manager' }, - { id: 'admin', name: 'Administrator' }, - { id: 'owner', name: 'Owner' } + { id: 'user', name: 'User', disabled: false }, + { id: 'usermanager', name: 'User Manager', disabled: true }, + { id: 'admin', name: 'Administrator', disabled: true }, + { id: 'owner', name: 'Owner', disabled: true } ]; $scope.allUsers = []; @@ -681,6 +681,17 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio } }); }); + Client.onReady(function () { + // Update available roles depending on features + if ($scope.config.features.userMaxCount === null) { + $scope.roles = [ + { id: 'user', name: 'User', disabled: false }, + { id: 'usermanager', name: 'User Manager', disabled: false }, + { id: 'admin', name: 'Administrator', disabled: false }, + { id: 'owner', name: 'Owner', disabled: false } + ]; + } + }); // setup all the dialog focus handling ['userAddModal', 'userRemoveModal', 'userEditModal', 'groupAddModal', 'groupEditModal', 'groupRemoveModal'].forEach(function (id) {