mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00: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()
|
exec_user_role = set()
|
||||||
if superuser:
|
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_role.add("Super User")
|
||||||
exec_user_crafty_permissions = (
|
exec_user_crafty_permissions = (
|
||||||
self.controller.crafty_perms.list_defined_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(
|
authorized_servers = self.controller.servers.get_authorized_servers(
|
||||||
user["user_id"] # TODO: API key authorized servers?
|
user["user_id"] # TODO: API key authorized servers?
|
||||||
)
|
)
|
||||||
page_servers = []
|
authorized_servers = [
|
||||||
for server in authorized_servers:
|
DatabaseShortcuts.get_data_obj(x.server_object)
|
||||||
if server not in page_servers:
|
for x in authorized_servers
|
||||||
page_servers.append(
|
]
|
||||||
DatabaseShortcuts.get_data_obj(server.server_object)
|
|
||||||
)
|
|
||||||
allowed_servers = page_servers
|
|
||||||
allowed_servers = [str(i) for i in allowed_servers]
|
|
||||||
|
|
||||||
logger.debug("Checking results")
|
logger.debug("Checking results")
|
||||||
if user:
|
if user:
|
||||||
return (
|
return (
|
||||||
allowed_servers,
|
authorized_servers,
|
||||||
exec_user_crafty_permissions,
|
exec_user_crafty_permissions,
|
||||||
exec_user_role,
|
exec_user_role,
|
||||||
superuser,
|
superuser,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user