mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-16 14:41:39 +00:00
some initial code to recursively merge access list (not used yet)
This commit is contained in:
parent
3a531462d9
commit
f7d695c015
|
@ -386,6 +386,10 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
*
|
*
|
||||||
* @return object parent folder
|
* @return object parent folder
|
||||||
*/
|
*/
|
||||||
|
function getParent() { /* {{{ */
|
||||||
|
return self::getFolder();
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
function getFolder() { /* {{{ */
|
function getFolder() { /* {{{ */
|
||||||
if (!isset($this->_folder))
|
if (!isset($this->_folder))
|
||||||
$this->_folder = $this->_dms->getFolder($this->_folderID);
|
$this->_folder = $this->_dms->getFolder($this->_folderID);
|
||||||
|
@ -971,7 +975,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
*
|
*
|
||||||
* @param integer $mode access mode (defaults to M_ANY)
|
* @param integer $mode access mode (defaults to M_ANY)
|
||||||
* @param integer $op operation (defaults to O_EQ)
|
* @param integer $op operation (defaults to O_EQ)
|
||||||
* @return array multi dimensional array
|
* @return array multi dimensional array or false in case of an error
|
||||||
*/
|
*/
|
||||||
function getAccessList($mode = M_ANY, $op = O_EQ) { /* {{{ */
|
function getAccessList($mode = M_ANY, $op = O_EQ) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
@ -979,7 +983,10 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
if ($this->inheritsAccess()) {
|
if ($this->inheritsAccess()) {
|
||||||
$res = $this->getFolder();
|
$res = $this->getFolder();
|
||||||
if (!$res) return false;
|
if (!$res) return false;
|
||||||
return $this->_folder->getAccessList($mode, $op);
|
$pacl = $res->getAccessList($mode, $op);
|
||||||
|
return $pacl;
|
||||||
|
} else {
|
||||||
|
$pacl = array("groups" => array(), "users" => array());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($this->_accessList[$mode])) {
|
if (!isset($this->_accessList[$mode])) {
|
||||||
|
@ -1006,6 +1013,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_accessList[$mode];
|
return $this->_accessList[$mode];
|
||||||
|
return SeedDMS_Core_DMS::mergeAccessLists($pacl, $this->_accessList[$mode]);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -915,7 +915,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
*
|
*
|
||||||
* @param integer $mode access mode (defaults to M_ANY)
|
* @param integer $mode access mode (defaults to M_ANY)
|
||||||
* @param integer $op operation (defaults to O_EQ)
|
* @param integer $op operation (defaults to O_EQ)
|
||||||
* @return array multi dimensional array
|
* @return array multi dimensional array or false in case of an error
|
||||||
*/
|
*/
|
||||||
function getAccessList($mode = M_ANY, $op = O_EQ) { /* {{{ */
|
function getAccessList($mode = M_ANY, $op = O_EQ) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
@ -923,7 +923,10 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
if ($this->inheritsAccess()) {
|
if ($this->inheritsAccess()) {
|
||||||
$res = $this->getParent();
|
$res = $this->getParent();
|
||||||
if (!$res) return false;
|
if (!$res) return false;
|
||||||
return $this->_parent->getAccessList($mode, $op);
|
$pacl = $res->getAccessList($mode, $op);
|
||||||
|
return $pacl;
|
||||||
|
} else {
|
||||||
|
$pacl = array("groups" => array(), "users" => array());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($this->_accessList[$mode])) {
|
if (!isset($this->_accessList[$mode])) {
|
||||||
|
@ -950,6 +953,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->_accessList[$mode];
|
return $this->_accessList[$mode];
|
||||||
|
return SeedDMS_Core_DMS::mergeAccessLists($pacl, $this->_accessList[$mode]);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user