From c7340ca0d43e7fc22a14ee012db9d8fb607595dc Mon Sep 17 00:00:00 2001 From: wrongecho Date: Sat, 14 Sep 2024 18:55:00 +0100 Subject: [PATCH] Permissions overhaul - Define permissions in the database 2nd attempt at this one! Similar to #1008 but separately defining the roles, modules and associated permissions in the database. Also has admin being a defined role automatically having full access. Parent issue: #530 --- admin_roles.php | 5 ----- functions.php | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/admin_roles.php b/admin_roles.php index d0b5005df..929130318 100644 --- a/admin_roles.php +++ b/admin_roles.php @@ -45,11 +45,6 @@ -
-
- -
-

diff --git a/functions.php b/functions.php index 108b80183..0711b222e 100644 --- a/functions.php +++ b/functions.php @@ -1356,13 +1356,13 @@ function lookupUserPermission($module) { $mysqli, "SELECT urp.user_role_permission_level - FROM + FROM modules AS m - JOIN + JOIN user_role_permissions AS urp - ON + ON m.module_id = urp.module_id - WHERE + WHERE m.module_name = '$module' AND urp.user_role_id = $session_user_role" );