Skip to content

Commit

Permalink
Merge pull request #2250 from nextcloud/fix/refactor-add-to-folder
Browse files Browse the repository at this point in the history
fix(FoldersController): Refactor addToFolder
  • Loading branch information
marcelklehr authored Dec 24, 2024
2 parents 09d9c80 + 14fd01b commit 007dcda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Controller/FoldersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public function getFolder($folderId): JSONResponse {
* @throws UnauthenticatedError
*/
public function addToFolder($folderId, $bookmarkId): JSONResponse {
if (!Authorizer::hasPermission(Authorizer::PERM_WRITE, $this->authorizer->getPermissionsForFolder($folderId, $this->request)) &&
if (!Authorizer::hasPermission(Authorizer::PERM_WRITE, $this->authorizer->getPermissionsForFolder($folderId, $this->request)) ||
!Authorizer::hasPermission(Authorizer::PERM_EDIT, $this->authorizer->getPermissionsForBookmark($bookmarkId, $this->request))) {
$res = new JSONResponse(['status' => 'error', 'data' => ['Not found']], Http::STATUS_NOT_FOUND);
$res->throttle();
Expand Down

0 comments on commit 007dcda

Please sign in to comment.