Merge pull request #660 from coreos-inc/superuser
Superuser Panel Improvements
This commit is contained in:
commit
4ae940aede
3 changed files with 80 additions and 5 deletions
|
@ -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({
|
||||
|
|
Reference in a new issue