SeedDMS_Folder_DMS::getAccessList() and getDefaultAccess() do not return fals anymore if the parent does not exists. They just stop inheritance.

This commit is contained in:
Uwe Steinmann 2020-10-03 10:18:04 +02:00
parent 91be15c60a
commit d867e5d0b8
2 changed files with 34 additions and 10 deletions

View File

@ -465,9 +465,13 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
*/
function getDefaultAccess() { /* {{{ */
if ($this->inheritsAccess()) {
/* Access is supposed to be inherited but it could be that there
* is no parent because the configured root folder id is somewhere
* below the actual root folder.
*/
$res = $this->getParent();
if (!$res) return false;
return $this->_parent->getDefaultAccess();
if ($res)
return $this->_parent->getDefaultAccess();
}
return $this->_defaultAccess;
@ -1226,9 +1230,13 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
$db = $this->_dms->getDB();
if ($this->inheritsAccess()) {
/* Access is supposed to be inherited but it could be that there
* is no parent because the configured root folder id is somewhere
* below the actual root folder.
*/
$res = $this->getParent();
if (!$res) return false;
return $this->_parent->getAccessList($mode, $op);
if ($res)
return $this->_parent->getAccessList($mode, $op);
}
if (!isset($this->_accessList[$mode])) {

View File

@ -15,8 +15,8 @@
<date>2020-09-29</date>
<time>13:44:55</time>
<version>
<release>5.1.20</release>
<api>5.1.20</api>
<release>5.1.21</release>
<api>5.1.21</api>
</version>
<stability>
<release>stable</release>
@ -24,10 +24,7 @@
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
- SeedDMS_Core_DMS::getDocumentList() returns false, if an unknown list is passed
- SeedDMS_Core_Document::getDocumentFiles() has new parameter to select only those files attached to a specific version of the document
- removing a document version will not remove attachments of the document anymore
- set dms of new user instances in SeedDMS_Core_Group
- SeedDMS_Folder_DMS::getAccessList() and getDefaultAccess() do not return fals anymore if the parent does not exists. They just stop inheritance.
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">
@ -1822,5 +1819,24 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
- add new attribute types 'document', 'folder', 'user', 'group'
</notes>
</release>
<release>
<date>2020-09-29</date>
<time>13:44:55</time>
<version>
<release>5.1.20</release>
<api>5.1.20</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
- SeedDMS_Core_DMS::getDocumentList() returns false, if an unknown list is passed
- SeedDMS_Core_Document::getDocumentFiles() has new parameter to select only those files attached to a specific version of the document
- removing a document version will not remove attachments of the document anymore
- set dms of new user instances in SeedDMS_Core_Group
</notes>
</release>
</changelog>
</package>