From 9f1906c4cbb9878c5888723b7923fa8e4bebb51f Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 27 Apr 2025 21:12:02 +0500 Subject: feat: roles --- public/report/list.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'public/report/list.php') diff --git a/public/report/list.php b/public/report/list.php index 128f994..087eb55 100644 --- a/public/report/list.php +++ b/public/report/list.php @@ -3,11 +3,17 @@ include_once "../../src/accounts.php"; include_once "../../src/config.php"; include_once "../../src/partials.php"; include_once "../../src/utils.php"; +include_once "../../src/alert.php"; if (!authorize_user(true)) { exit; } +if (isset($_SESSION["user_role"]) && !$_SESSION["user_role"]["permission_report"]) { + generate_alert("/404.php", "Not enough permissions", 403); + exit; +} + $db = new PDO(DB_URL, DB_USER, DB_PASS); $stmt = $db->prepare("SELECT * FROM reports WHERE sender_id = ? ORDER BY sent_at DESC"); -- cgit v1.2.3