mirror of
https://github.com/nextcloud/server.git
synced 2025-03-15 00:43:23 +00:00
Check node permissions when restoring a version
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
741dec283f
commit
37d0fd109a
1 changed files with 4 additions and 0 deletions
|
@ -178,6 +178,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