From 175f35e4954e87bcc6641e32eda9dd56980ea75f Mon Sep 17 00:00:00 2001 From: aldo Date: Tue, 26 Nov 2024 11:17:45 -0600 Subject: [PATCH 1/2] This will turn on the superadmins is_admin column to true allowing it to pass admincheck() on more secure routes --- BackEndFlask/models/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BackEndFlask/models/user.py b/BackEndFlask/models/user.py index cd200d141..dc9cf4624 100644 --- a/BackEndFlask/models/user.py +++ b/BackEndFlask/models/user.py @@ -186,7 +186,7 @@ def create_user(user_data): lms_id=user_data["lms_id"], consent=user_data["consent"], owner_id=user_data["owner_id"], - is_admin="role_id" in user_data.keys() and user_data["role_id"]==3, + is_admin="role_id" in user_data.keys() and user_data["role_id"] in [1,2,3], has_set_password=has_set_password, reset_code=None ) @@ -243,7 +243,7 @@ def load_SuperAdminUser(): "lms_id": 0, "consent": None, "owner_id": None, - "role_id": None, + "role_id": 2, "is_admin": True }) From e06d67e149b16a1fa88b08b70ccdff5bef071652 Mon Sep 17 00:00:00 2001 From: aldo Date: Tue, 26 Nov 2024 12:40:09 -0600 Subject: [PATCH 2/2] changed the comparision symbol to pass checks --- FrontEndReact/src/View/Admin/Add/AddUsers/AdminAddUser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FrontEndReact/src/View/Admin/Add/AddUsers/AdminAddUser.js b/FrontEndReact/src/View/Admin/Add/AddUsers/AdminAddUser.js index 791169c53..fe4bab14c 100644 --- a/FrontEndReact/src/View/Admin/Add/AddUsers/AdminAddUser.js +++ b/FrontEndReact/src/View/Admin/Add/AddUsers/AdminAddUser.js @@ -188,7 +188,7 @@ class AdminAddUser extends Component { "first_name": firstName, "last_name": lastName, "email": email, - "lms_id": lmsId != "" ? lmsId : null, + "lms_id": lmsId !== "" ? lmsId : null, "consent": null, "owner_id": cookies.get('user')['user_id'], "role_id": navbar.props.isSuperAdmin ? 3 : role