remove mergeAccessList()

This commit is contained in:
Uwe Steinmann 2016-11-24 12:00:54 +01:00
parent 9346fa6072
commit 32d484a924

View File

@ -334,61 +334,6 @@ class SeedDMS_Core_DMS {
return $tmp;
} /* }}} */
/**
* Merge access lists
*
* Merges two access lists. Objects of the second list will override objects
* in the first list.
*
* @param array $first list of access rights as returned by
* SeedDMS_Core_Document:: getAccessList() or SeedDMS_Core_Folder::getAccessList()
* @param array $secont list of access rights
* @return array merged list
*/
static function mergeAccessLists($first, $second) { /* {{{ */
if($first && !$second)
return $first;
if(!$first && $second)
return $second;
$tmp = array('users'=>array(), 'groups'=>array());
if(!isset($first['users']) || !isset($first['groups']) ||
!isset($second['users']) || !isset($second['groups']))
return false;
foreach ($first['users'] as $f) {
$new = $f;
foreach ($second['users'] as $i=>$s) {
if($f->getUserID() == $s->getUserID()) {
$new = $s;
unset($second['users'][$i]);
break;
}
}
array_push($tmp['users'], $new);
}
foreach ($seconf['users'] as $f) {
array_push($tmp['users'], $f);
}
foreach ($first['groups'] as $f) {
$new = $f;
foreach ($second['groups'] as $i=>$s) {
if($f->getGroupID() == $s->getGroupID()) {
$new = $s;
unset($second['groups'][$i]);
break;
}
}
array_push($tmp['groups'], $new);
}
foreach ($second['groups'] as $f) {
array_push($tmp['groups'], $f);
}
return $tmp;
} /* }}} */
/**
* Create a new instance of the dms
*