Source code for galaxy.webapps.galaxy.controllers.userskeys

Contains the user interface in the Universe class

from sqlalchemy import false

from galaxy import (
from galaxy.model.base import transaction
from galaxy.webapps.base.controller import (

[docs]class User(BaseUIController, UsesFormDefinitionsMixin):
[docs] @web.expose @web.require_login() @web.require_admin def index(self, trans, cntrller, **kwd): return self.get_all_users(trans)
[docs] @web.expose @web.require_login() @web.require_admin def admin_api_keys(self, trans, uid, **kwd): params = util.Params(kwd) uid = params.get("uid", uid) new_key = new_key.user_id = new_key.key = trans.sa_session.add(new_key) with transaction(trans.sa_session): trans.sa_session.commit() return self.get_all_users(trans)
[docs] @web.expose @web.require_login() @web.require_admin def all_users(self, trans, **kwd): return self.get_all_users(trans)
[docs] @web.json def get_all_users(self, trans): users = [] for user in ( trans.sa_session.query( .filter( == false()) .order_by( ): uid = int( userkey = "" for api_user in trans.sa_session.query( == uid ): userkey = api_user.key users.append({"uid":, "email":, "key": userkey}) return users