make mayEditVersion() work again

This commit is contained in:
Uwe Steinmann 2016-03-23 16:53:01 +01:00
parent c7836aabfe
commit a693233150

View File

@ -62,12 +62,12 @@ class SeedDMS_AccessOperation {
* document may delete versions. The admin may even delete a version
* even if is disallowed in the settings.
*/
function mayEditVersion() { /* {{{ */
if(get_class($this->obj) == 'SeedDMS_Core_Document') {
$version = $this->obj->getLatestContent();
function mayEditVersion($document) { /* {{{ */
if(get_class($document) == $this->dms->getClassname('document')) {
$version = $document->getLatestContent();
if (!isset($this->settings->_editOnlineFileTypes) || !is_array($this->settings->_editOnlineFileTypes) || !in_array(strtolower($version->getFileType()), $this->settings->_editOnlineFileTypes))
return false;
if ($this->obj->getAccessMode($this->user) == M_ALL || $this->user->isAdmin()) {
if ($document->getAccessMode($this->user) == M_ALL || $this->user->isAdmin()) {
return true;
}
}