Skip to content

Commit 7acb239

Browse files
committed
Merge #3 [backport25] Add the root lock blocker
2 parents 83cc75c + bc78b5f commit 7acb239

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Controller/LockingController.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ public function lockFolder(int $id): DataResponse {
9090
throw new OCSForbiddenException($this->l10n->t('You are not allowed to create the lock'));
9191
}
9292

93+
if ($userFolder->getId() === $id) {
94+
throw new OCSForbiddenException($this->l10n->t('You are not allowed to lock the root'));
95+
}
96+
9397
$nodes = $userFolder->getById($id);
9498
if (!isset($nodes[0]) || !$nodes[0] instanceof Folder) {
9599
throw new OCSForbiddenException($this->l10n->t('You are not allowed to create the lock'));

0 commit comments

Comments
 (0)