Check record-level permissions

This commit is contained in:
nathangray 2018-05-31 10:16:29 -06:00
parent 3d45c7193b
commit a5f5930064

View File

@ -1204,13 +1204,16 @@ class Contacts extends Contacts\Storage
{ {
$access = !!array_intersect($memberships,$GLOBALS['egw']->accounts->memberships($contact['account_id'],true)); $access = !!array_intersect($memberships,$GLOBALS['egw']->accounts->memberships($contact['account_id'],true));
} }
else if ($contact['id'] && $GLOBALS['egw']->acl->check('A'.$contact['id'], $needed, 'addressbook'))
{
$access = true;
}
else else
{ {
$access = ($grants[$owner] & $needed) && $access = ($grants[$owner] & $needed) &&
(!$contact['private'] || ($grants[$owner] & Acl::PRIVAT) || in_array($owner,$memberships)); (!$contact['private'] || ($grants[$owner] & Acl::PRIVAT) || in_array($owner,$memberships));
} }
//error_log(__METHOD__."($needed,$contact[id],$deny_account_delete,$user) returning ".array2string($access)); //error_log(__METHOD__."($needed,$contact[id],$deny_account_delete,$user) returning ".array2string($access));
return true;
return $access; return $access;
} }