mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 09:45:28 +01:00
Giving json to auth_data
This commit is contained in:
parent
bc16e0df2b
commit
98fa8e8940
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user