Add ability to update superusers via the UI

Fixes #634
This commit is contained in:
Joseph Schorr 2015-10-16 15:38:06 -04:00
parent a37b9394d9
commit d464af4cce
3 changed files with 49 additions and 1 deletions

View file

@ -160,6 +160,31 @@
}, errorHandler)
};
$scope.setSuperuser = function(user, status) {
var setSuperuser = function() {
var params = {
'username': user.username
};
var data = {
'superuser': status
};
ApiService.changeInstallUser(data, params).then(function(resp) {
$scope.requiresRestart = true;
}, ApiService.errorDisplay('Could not change user'));
};
var msg = 'Note: This change, once applied, will require your installation ' +
'to be restarted to take effect';
bootbox.confirm(msg, function(status) {
if (status) {
setSuperuser();
}
});
};
$scope.showDeleteUser = function(user) {
if (user.username == UserService.currentUser().username) {
bootbox.dialog({