Allow superusers to disable user accounts
This commit is contained in:
parent
442cbed087
commit
dc5af7496c
19 changed files with 291 additions and 37 deletions
|
@ -232,6 +232,32 @@
|
|||
});
|
||||
};
|
||||
|
||||
$scope.askDisableUser = function(user) {
|
||||
var message = 'Are you sure you want to disable this user? ' +
|
||||
'They will be unable to login, pull or push.'
|
||||
|
||||
if (!user.enabled) {
|
||||
message = 'Are you sure you want to reenable this user? ' +
|
||||
'They will be able to login, pull or push.'
|
||||
}
|
||||
|
||||
bootbox.confirm(message, function(resp) {
|
||||
if (resp) {
|
||||
var params = {
|
||||
'username': user.username
|
||||
};
|
||||
|
||||
var data = {
|
||||
'enabled': !user.enabled
|
||||
};
|
||||
|
||||
ApiService.changeInstallUser(data, params).then(function(resp) {
|
||||
$scope.loadUsersInternal();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.changeUserPassword = function(user) {
|
||||
$('#changePasswordModal').modal('hide');
|
||||
|
||||
|
|
Reference in a new issue