mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Check permissions when labeling a version
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
37d0fd109a
commit
046b8f320f
1 changed files with 4 additions and 0 deletions
|
|
@ -228,6 +228,10 @@ class LegacyVersionsBackend implements IVersionBackend, INameableVersionBackend,
|
|||
}
|
||||
|
||||
public function setVersionLabel(IVersion $version, string $label): void {
|
||||
if (!$this->currentUserHasPermissions($version, \OCP\Constants::PERMISSION_UPDATE)) {
|
||||
throw new Forbidden('You cannot label this version because you do not have update permissions on the source file.');
|
||||
}
|
||||
|
||||
$versionEntity = $this->versionsMapper->findVersionForFileId(
|
||||
$version->getSourceFile()->getId(),
|
||||
$version->getTimestamp(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue