Allow superusers to disable user accounts

This commit is contained in:
Joseph Schorr 2015-05-11 17:13:42 -04:00
parent 442cbed087
commit dc5af7496c
19 changed files with 291 additions and 37 deletions

View file

@ -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');