mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
use access operations to check if operation is allowed
before, this was some own code which did not same the same check as maySetReviewerApprover()
This commit is contained in:
parent
401e995df6
commit
d070f6da85
|
@ -54,18 +54,14 @@ if(!$settings->_enableVersionModification) {
|
|||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("no_version_modification"));
|
||||
}
|
||||
|
||||
// control for document state. Must correspond to check in
|
||||
// SeedDMS_AccessOperation::maySetReviewersApprovers()
|
||||
$overallStatus = $content->getStatus();
|
||||
if ($overallStatus["status"]!=S_DRAFT_REV && $overallStatus["status"]!=S_DRAFT_APP) {
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
|
||||
if (!$accessop->maySetReviewersApprovers()) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("cannot_assign_invalid_state"));
|
||||
}
|
||||
|
||||
$folder = $document->getFolder();
|
||||
|
||||
/* Create object for checking access to certain operations */
|
||||
$accessop = new SeedDMS_AccessOperation($document, $user, $settings);
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'folder'=>$folder, 'document'=>$document, 'version'=>$content, 'enableadminrevapp'=>$settings->_enableAdminRevApp, 'enableownerrevapp'=>$settings->_enableOwnerRevApp, 'enableselfrevapp'=>$settings->_enableSelfRevApp));
|
||||
if($view) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user