mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Check node permissions when restoring a version
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
231e27c436
commit
ee7c5778f6
1 changed files with 4 additions and 0 deletions
|
|
@ -176,6 +176,10 @@ class LegacyVersionsBackend implements IVersionBackend, INameableVersionBackend,
|
|||
}
|
||||
|
||||
public function rollback(IVersion $version) {
|
||||
if (!$this->currentUserHasPermissions($version, \OCP\Constants::PERMISSION_UPDATE)) {
|
||||
throw new Forbidden('You cannot restore this version because you do not have update permissions on the source file.');
|
||||
}
|
||||
|
||||
return Storage::rollback($version->getVersionPath(), $version->getRevisionId(), $version->getUser());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue