mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
use access operation to check if approval is allowed
Conflicts: op/op.ApproveDocument.php Conflicts: op/op.ApproveDocument.php
This commit is contained in:
parent
ecafa39d1e
commit
15a708fbf2
|
@ -27,6 +27,7 @@ include("../inc/inc.Init.php");
|
|||
include("../inc/inc.Extension.php");
|
||||
include("../inc/inc.ClassEmail.php");
|
||||
include("../inc/inc.DBInit.php");
|
||||
include("../inc/inc.ClassAccessOperation.php");
|
||||
include("../inc/inc.Authentication.php");
|
||||
include("../inc/inc.ClassUI.php");
|
||||
include("../inc/inc.ClassController.php");
|
||||
|
@ -73,9 +74,12 @@ if ($latestContent->getVersion()!=$version) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
|
||||
}
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
|
||||
|
||||
$olddocstatus = $content->getStatus();
|
||||
// verify if document has expired
|
||||
if ($document->hasExpired()){
|
||||
// verify if document may be approved
|
||||
if ($accessop->mayApprove()){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
|
|
@ -61,8 +61,9 @@ $latestContent = $document->getLatestContent();
|
|||
if ($latestContent->getVersion()!=$version) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("invalid_version"));
|
||||
}
|
||||
// verify if document has expired
|
||||
if ($document->hasExpired()){
|
||||
|
||||
// verify if document may be approved
|
||||
if ($accessop->mayApprove()){
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user