Disable role selection for Cloudrons with user restriction

This commit is contained in:
Johannes Zellner
2020-02-26 16:48:51 +01:00
parent a3830d23e8
commit e7b9c2d294
3 changed files with 20 additions and 9 deletions

View File

@@ -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) {