From 046228a0e1546eec1d68607d66f78c3db06c8584 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 9 Aug 2021 17:18:02 -0400 Subject: [PATCH] Fixed bug that I created in create roles. Just didn't add data to the page that should have been there --- app/classes/web/panel_handler.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 0ac59196..ebb2dfd9 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -385,6 +385,12 @@ class PanelHandler(BaseHandler): self.redirect("/panel/panel_config") elif page == "add_role": + user_roles = {} + for user in db_helper.get_all_users(): + user_roles_list = db_helper.get_user_roles_names(user.user_id) + user_servers = db_helper.get_all_authorized_servers(user.user_id) + data = {user.user_id: user_roles_list} + user_roles.update(data) page_data['new_role'] = True page_data['role'] = {} page_data['role']['role_name'] = "" @@ -392,6 +398,8 @@ class PanelHandler(BaseHandler): page_data['role']['created'] = "N/A" page_data['role']['last_update'] = "N/A" page_data['role']['servers'] = set() + page_data['user-roles'] = user_roles + page_data['users'] = db_helper.get_all_users() if not exec_user['superuser']: self.redirect("/panel/error?error=Unauthorized access: not superuser")