Update: Allow superadmin role to manage trips alongside admin

This commit is contained in:
twotalesanimation
2025-12-04 17:06:34 +02:00
parent 674af23994
commit 1767337d99
4 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ require_once($rootPath . '/src/config/connection.php');
// Check admin status
session_start();
if (empty($_SESSION['user_id']) || $_SESSION['role'] !== 'admin') {
if (empty($_SESSION['user_id']) || !in_array($_SESSION['role'] ?? '', ['admin', 'superadmin'])) {
ob_end_clean();
echo json_encode(['status' => 'error', 'message' => 'Unauthorized access']);
exit;