mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-15 06:01:19 +00:00
use mayRemoveVersion()
This commit is contained in:
parent
fcf5c9be93
commit
183bdcfa69
|
@ -43,8 +43,12 @@ if (!is_object($document)) {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$settings->_enableVersionDeletion && !$user->isAdmin()) {
|
/* Create object for checking access to certain operations */
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("access_denied"));
|
$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) {
|
if ($document->getAccessMode($user, 'removeVersion') < M_ALL) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user