mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
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:
parent
5ee7110597
commit
d2ccd5d5ad
|
@ -236,15 +236,15 @@ class SeedDMS_AccessOperation {
|
|||
/**
|
||||
* Check if document content may be reviewed
|
||||
*
|
||||
* Reviewing a document content is only allowed if the document was not
|
||||
* obsoleted. There are other requirements which are not taken into
|
||||
* Reviewing a document content is only allowed if the document is in
|
||||
* review. There are other requirements which are not taken into
|
||||
* account here.
|
||||
*/
|
||||
function mayReview() { /* {{{ */
|
||||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ($status["status"]!=S_OBSOLETE) {
|
||||
if ($status["status"]==S_DRAFT_REV) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -269,8 +269,9 @@ class SeedDMS_AccessOperation {
|
|||
/**
|
||||
* Check if document content may be approved
|
||||
*
|
||||
* Approving a document content is only allowed if the document was not
|
||||
* obsoleted and the document is not in review status.
|
||||
* Approving a document content is only allowed if the document is either
|
||||
* in approval status or released. In the second case the approval can be
|
||||
* edited.
|
||||
* There are other requirements which are not taken into
|
||||
* account here.
|
||||
*/
|
||||
|
@ -278,7 +279,7 @@ class SeedDMS_AccessOperation {
|
|||
if(get_class($this->obj) == $this->dms->getClassname('document')) {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user