mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
fix contacts shared with a user are not visible in his personal AB, but when all addressbooks selected
This commit is contained in:
parent
ea41ab8e77
commit
9567a1fed3
@ -505,8 +505,7 @@ class Sql extends Api\Storage
|
||||
$this->db->expression(self::SHARED_TABLE, ['shared_with' => $filter['owner'] ?? array_keys($this->grants)]).')';
|
||||
|
||||
// add filter for read ACL in sql, if user is NOT the owner of the addressbook
|
||||
if (isset($this->grants) && !$ignore_acl &&
|
||||
!(isset($filter['owner']) && $filter['owner'] == $GLOBALS['egw_info']['user']['account_id']))
|
||||
if (isset($this->grants) && !$ignore_acl)
|
||||
{
|
||||
// add read ACL for groupmembers (they have no
|
||||
if ($GLOBALS['egw_info']['user']['preferences']['common']['account_selection'] == 'groupmembers' &&
|
||||
@ -549,6 +548,12 @@ class Sql extends Api\Storage
|
||||
" OR contact_private=0 AND $this->table_name.contact_owner IN (".
|
||||
implode(',',array_keys($this->grants)).") $groupmember_sql OR $this->table_name.contact_owner IS NULL)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$filter[] = '('.$this->db->expression($this->table_name, $this->table_name.'.', ['contact_owner' => $filter['owner']]).
|
||||
" OR $shared_sql)";
|
||||
unset($filter['owner']);
|
||||
}
|
||||
}
|
||||
else // search all addressbooks, incl. accounts
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user