add JupyterHub.admin_access

optionally allow admin users to login to user servers by visiting a special admin-only URL that sets the relevant cookie

- disabled by default
- an 'access server' button is added to the admin panel, which sets the necessary cookie to log in to the user server
This commit is contained in:
Min RK
2015-01-27 17:04:30 -08:00
parent 6dc65d55a5
commit 6b9f73ba1f
8 changed files with 72 additions and 5 deletions

View File

@@ -100,6 +100,19 @@ define(['jquery', 'utils'], function ($, utils) {
);
};
JHAPI.prototype.admin_access = function (user, options) {
options = options || {};
options = update(options, {
type: 'POST',
dataType: null,
});
this.api_request(
utils.url_path_join('users', user, 'admin-access'),
options
);
};
JHAPI.prototype.delete_user = function (user, options) {
options = options || {};
options = update(options, {type: 'DELETE', dataType: null});