diff --git a/op/op.CheckInDocument.php b/op/op.CheckInDocument.php index b870fc2ee..8a9c43757 100644 --- a/op/op.CheckInDocument.php +++ b/op/op.CheckInDocument.php @@ -26,6 +26,8 @@ include("../inc/inc.DBInit.php"); include("../inc/inc.ClassUI.php"); include("../inc/inc.Authentication.php"); +$accessop = new SeedDMS_AccessOperation($dms, $user, $settings); + /* Check if the form data comes from a trusted request */ if(!checkFormKey('checkindocument')) { UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_request_token"))),getMLText("invalid_request_token")); @@ -62,6 +64,10 @@ if ($document->isLocked()) { else $document->setLocked(false); } +if(!$accessop->mayCheckIn($document)) { + UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied")); +} + if(isset($_POST["comment"])) $comment = $_POST["comment"]; else