From 183bdcfa692f2a4cf04d1e5d9ff9521a818805ca Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 13 Oct 2023 13:33:58 +0200 Subject: [PATCH] use mayRemoveVersion() --- op/op.RemoveVersion.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/op/op.RemoveVersion.php b/op/op.RemoveVersion.php index 8c224209a..146b41f2a 100644 --- a/op/op.RemoveVersion.php +++ b/op/op.RemoveVersion.php @@ -43,8 +43,12 @@ if (!is_object($document)) { UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); } -if (!$settings->_enableVersionDeletion && !$user->isAdmin()) { - UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied")); +/* Create object for checking access to certain operations */ +$accessop = new SeedDMS_AccessOperation($dms, $document, $user, $settings); + +// verify if document may be reviewed +if (!$accessop->mayRemoveVersion()){ + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); } if ($document->getAccessMode($user, 'removeVersion') < M_ALL) {