Disable roles the current user cannot assign
This commit is contained in:
@@ -690,15 +690,12 @@ angular.module('Application').controller('UsersController', ['$scope', '$locatio
|
||||
Client.onReady(function () { if ($scope.user.isAtLeastAdmin) loadExternalLdapConfig(); });
|
||||
Client.onReady(refreshAllUsers);
|
||||
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 }
|
||||
];
|
||||
}
|
||||
$scope.roles = [
|
||||
{ id: 'user', name: 'User', disabled: false },
|
||||
{ id: 'usermanager', name: 'User Manager', disabled: false },
|
||||
{ id: 'admin', name: 'Administrator', disabled: !$scope.user.isAtLeastAdmin },
|
||||
{ id: 'owner', name: 'Owner', disabled: !$scope.user.isAtLeastOwner }
|
||||
];
|
||||
});
|
||||
|
||||
// setup all the dialog focus handling
|
||||
|
||||
Reference in New Issue
Block a user