mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +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"));
|
||||
}
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user