add new method mayCheckIn()

This commit is contained in:
Uwe Steinmann 2023-03-13 10:18:14 +01:00
parent fe0fd30971
commit 7ae5749bcf

View File

@ -411,6 +411,24 @@ class SeedDMS_AccessOperation {
return false;
} /* }}} */
/**
* Check if document content may be checked in
*
*
*/
function mayCheckIn($document) { /* {{{ */
if($document->isType('document')) {
$checkoutinfo = $document->getCheckOutInfo();
if(!$checkoutinfo)
return false;
$info = $checkoutinfo[0];
if($this->user->getID() == $info['userID'] || $document->getAccessMode($this->user) == M_ALL) {
return true;
}
}
return false;
} /* }}} */
protected function check_view_legacy_access($view, $get=array()) { /* {{{ */
if($this->user->isAdmin())
return true;