Giving json to auth_data

This commit is contained in:
Silversthorn 2022-07-18 20:57:04 +02:00
parent bc16e0df2b
commit 98fa8e8940

View File

@ -179,7 +179,7 @@ class BaseHandler(tornado.web.RequestHandler):
exec_user_role = set()
if superuser:
allowed_servers = self.controller.servers.get_all_defined_servers()
authorized_servers = self.controller.servers.get_all_defined_servers()
exec_user_role.add("Super User")
exec_user_crafty_permissions = (
self.controller.crafty_perms.list_defined_crafty_permissions()
@ -205,19 +205,15 @@ class BaseHandler(tornado.web.RequestHandler):
authorized_servers = self.controller.servers.get_authorized_servers(
user["user_id"] # TODO: API key authorized servers?
)
page_servers = []
for server in authorized_servers:
if server not in page_servers:
page_servers.append(
DatabaseShortcuts.get_data_obj(server.server_object)
)
allowed_servers = page_servers
allowed_servers = [str(i) for i in allowed_servers]
authorized_servers = [
DatabaseShortcuts.get_data_obj(x.server_object)
for x in authorized_servers
]
logger.debug("Checking results")
if user:
return (
allowed_servers,
authorized_servers,
exec_user_crafty_permissions,
exec_user_role,
superuser,