userPermissions issue fixed

This commit is contained in:
Ryan
2025-04-03 22:06:49 -04:00
committed by GitHub
parent 46e9761cae
commit 6926d5b065
9 changed files with 14 additions and 17 deletions

View File

@@ -23,9 +23,9 @@ if ($receivedToken !== $_SESSION['csrf_token']) {
http_response_code(403);
exit;
}
$userPermissions = loadUserPermissions($username);
// Check if the user is read-only. (Assuming that if readOnly is true, deletion is disallowed.)
$username = $_SESSION['username'] ?? '';
$userPermissions = loadUserPermissions($username);
if ($username) {
$userPermissions = loadUserPermissions($username);
if (isset($userPermissions['readOnly']) && $userPermissions['readOnly'] === true) {