better check in mayReview() and mayApprove()

mayReview() will only return true anymore, if the status is S_DRAFT_REV.
mayApprove() will only return true anymore, if the status is S_DRAFT_APP.
This commit is contained in:
Uwe Steinmann 2018-01-08 10:49:36 +01:00
parent 5ee7110597
commit d2ccd5d5ad

View File

@ -236,15 +236,15 @@ class SeedDMS_AccessOperation {
/** /**
* Check if document content may be reviewed * Check if document content may be reviewed
* *
* Reviewing a document content is only allowed if the document was not * Reviewing a document content is only allowed if the document is in
* obsoleted. There are other requirements which are not taken into * review. There are other requirements which are not taken into
* account here. * account here.
*/ */
function mayReview() { /* {{{ */ function mayReview() { /* {{{ */
if(get_class($this->obj) == $this->dms->getClassname('document')) { if(get_class($this->obj) == $this->dms->getClassname('document')) {
$latestContent = $this->obj->getLatestContent(); $latestContent = $this->obj->getLatestContent();
$status = $latestContent->getStatus(); $status = $latestContent->getStatus();
if ($status["status"]!=S_OBSOLETE) { if ($status["status"]==S_DRAFT_REV) {
return true; return true;
} }
} }
@ -269,8 +269,9 @@ class SeedDMS_AccessOperation {
/** /**
* Check if document content may be approved * Check if document content may be approved
* *
* Approving a document content is only allowed if the document was not * Approving a document content is only allowed if the document is either
* obsoleted and the document is not in review status. * in approval status or released. In the second case the approval can be
* edited.
* There are other requirements which are not taken into * There are other requirements which are not taken into
* account here. * account here.
*/ */
@ -278,7 +279,7 @@ class SeedDMS_AccessOperation {
if(get_class($this->obj) == $this->dms->getClassname('document')) { if(get_class($this->obj) == $this->dms->getClassname('document')) {
$latestContent = $this->obj->getLatestContent(); $latestContent = $this->obj->getLatestContent();
$status = $latestContent->getStatus(); $status = $latestContent->getStatus();
if ($status["status"]!=S_OBSOLETE && $status["status"]!=S_DRAFT_REV && $status["status"]!=S_REJECTED) { if ($status["status"]==S_DRAFT_APP) {
return true; return true;
} }
} }