Disable role selection for Cloudrons with user restriction
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user