Fix FolderController readOnly create folder permission
This commit is contained in:
@@ -46,6 +46,7 @@
|
|||||||
- Updated all endpoints to use correct controller casing
|
- 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`)
|
- 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
|
- Adjusted endpoint paths to match controller filenames
|
||||||
|
- Fix FolderController readOnly create folder permission
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,11 @@ class FolderController
|
|||||||
$username = $_SESSION['username'] ?? '';
|
$username = $_SESSION['username'] ?? '';
|
||||||
$userPermissions = loadUserPermissions($username);
|
$userPermissions = loadUserPermissions($username);
|
||||||
if ($username && isset($userPermissions['readOnly']) && $userPermissions['readOnly'] === true) {
|
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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user