mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-09-09 19:38:57 +00:00
move filterDocumentLinks() from inc.Util.php to Core/inc.ClassDMS.php
This commit is contained in:
parent
0c89264f79
commit
21437e5a90
|
@ -205,6 +205,24 @@ class SeedDMS_Core_DMS {
|
||||||
return $newArr;
|
return $newArr;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filter document links
|
||||||
|
*
|
||||||
|
* Returns a filtered list of links which are accessible by the
|
||||||
|
* given user.
|
||||||
|
*
|
||||||
|
* @param array $links list of objects of type SeedDMS_Core_DocumentLink
|
||||||
|
* @param object $user user for which access is being checked
|
||||||
|
* @return filtered list of links
|
||||||
|
*/
|
||||||
|
static function filterDocumentLinks($user, $links) { /* {{{ */
|
||||||
|
$tmp = array();
|
||||||
|
foreach ($links as $link)
|
||||||
|
if ($link->isPublic() || ($link->getUser()->getID() == $user->getID()) || $user->isAdmin())
|
||||||
|
array_push($tmp, $link);
|
||||||
|
return $tmp;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance of the dms
|
* Create a new instance of the dms
|
||||||
*
|
*
|
||||||
|
|
|
@ -323,14 +323,6 @@ function _add_log_line($msg="") { /* {{{ */
|
||||||
return $txtpath;
|
return $txtpath;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function filterDocumentLinks($user, $links) { /* {{{ */
|
|
||||||
$tmp = array();
|
|
||||||
foreach ($links as $link)
|
|
||||||
if ($link->isPublic() || ($link->getUser()->getID() == $user->getID()) || $user->isAdmin())
|
|
||||||
array_push($tmp, $link);
|
|
||||||
return $tmp;
|
|
||||||
} /* }}} */
|
|
||||||
|
|
||||||
function showtree() { /* {{{ */
|
function showtree() { /* {{{ */
|
||||||
global $settings;
|
global $settings;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user