Fix FolderController readOnly create folder permission

This commit is contained in:
Ryan
2025-05-04 01:22:43 -04:00
committed by GitHub
parent 56f34ba362
commit 8d6a1be777
2 changed files with 7 additions and 2 deletions

View File

@@ -46,6 +46,7 @@
- Updated all endpoints to use correct controller casing
- Renamed controller files to PascalCase (e.g. `adminController.php` to `AdminController.php`, `fileController.php` to `FileController.php`, `folderController.php` to `FolderController.php`)
- Adjusted endpoint paths to match controller filenames
- Fix FolderController readOnly create folder permission
---

View File

@@ -76,7 +76,11 @@ class FolderController
$username = $_SESSION['username'] ?? '';
$userPermissions = loadUserPermissions($username);
if ($username && isset($userPermissions['readOnly']) && $userPermissions['readOnly'] === true) {
echo json_encode(["error" => "Read-only users are not allowed to create folders."]);
http_response_code(403);
echo json_encode([
"success" => false,
"error" => "Read-only users are not allowed to create folders."
]);
exit;
}
@@ -1074,7 +1078,7 @@ class FolderController
header("Location: " . $redirectUrl);
exit;
}
/**
* GET /api/folder/getShareFolderLinks.php
*/