mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-30 20:04:30 +01:00
Try to fix contact sharing filemanager access
This commit is contained in:
parent
c1182f13c0
commit
1e1090f0a1
@ -143,6 +143,12 @@ class Link extends Link\Storage
|
||||
* Turns on debug-messages
|
||||
*/
|
||||
const DEBUG = false;
|
||||
|
||||
/**
|
||||
* Flag to mark an app+id as not cacheable
|
||||
*/
|
||||
const NO_CACHE_FLAG = "NO CACHE";
|
||||
|
||||
/**
|
||||
* other apps can participate in the linking by implementing a 'search_link' hook, which
|
||||
* has to return an array in the format of an app_register entry below
|
||||
@ -156,7 +162,8 @@ class Link extends Link\Storage
|
||||
'icon' => 'addressbook/accounts',
|
||||
'query' => 'EGroupware\\Api\\Accounts::link_query',
|
||||
'title' => 'EGroupware\\Api\\Accounts::title',
|
||||
'view' => array('menuaction'=>'addressbook.addressbook_ui.view','ajax'=>'true'),
|
||||
'view' => array('menuaction' => 'addressbook.addressbook_ui.view',
|
||||
'ajax' => 'true'),
|
||||
'view_id' => 'account_id'
|
||||
),
|
||||
'api' => array(
|
||||
@ -1788,16 +1795,21 @@ class Link extends Link\Storage
|
||||
|
||||
$ret = $cache =& self::get_cache($app, $id,'file_access');
|
||||
|
||||
if (!isset($ret) || $required == Acl::EDIT && !($ret & $required))
|
||||
if(!isset($ret) || $ret == self::NO_CACHE_FLAG || $required == Acl::EDIT && !($ret & $required))
|
||||
{
|
||||
if(($method = self::get_registry($app, 'file_access')))
|
||||
{
|
||||
$ret = self::exec($method, array($id, $required, $rel_path));
|
||||
// bool return value means cacheable, non-bool, means not cacheable, because of $rel_path
|
||||
if (is_bool($ret))
|
||||
if(is_bool($ret) && $cache !== self::NO_CACHE_FLAG)
|
||||
{
|
||||
$cache |= $ret ? $required | Acl::READ : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Do not cache anything for this app+id or any non boolean (false) will override
|
||||
$cache = self::NO_CACHE_FLAG;
|
||||
}
|
||||
$ret = $ret ? $required|Acl::READ : 0;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user