new acl to view the calendar of a contact, thought every event is private, if you are not a participant

This commit is contained in:
Ralf Becker 2007-06-19 17:04:58 +00:00
parent 1651819dce
commit cbc565c0ce
2 changed files with 9 additions and 3 deletions

View File

@ -21,6 +21,12 @@ define('HOUR_s',60*60);
define('DAY_s',24*HOUR_s); define('DAY_s',24*HOUR_s);
define('WEEK_s',7*DAY_s); define('WEEK_s',7*DAY_s);
/**
* Gives read access to the calendar, but all events the user is not participating are private!
* Used be the addressbook.
*/
define('EGW_ACL_READ_FOR_PARTICIPANTS',EGW_ACL_CUSTOM_1);
/** /**
* Class to access all calendar data * Class to access all calendar data
* *
@ -271,7 +277,7 @@ class bocal
$users = array(); $users = array();
foreach($params['users'] as $user) foreach($params['users'] as $user)
{ {
if ($params['ignore_acl'] || $this->check_perms(EGW_ACL_READ,0,$user)) if ($params['ignore_acl'] || $this->check_perms(EGW_ACL_READ|EGW_ACL_READ_FOR_PARTICIPANTS,0,$user))
{ {
if ($user && !in_array($user,$users)) // already added? if ($user && !in_array($user,$users)) // already added?
{ {

View File

@ -189,13 +189,13 @@ class uical
foreach($GLOBALS['egw']->accounts->member($owner) as $member) foreach($GLOBALS['egw']->accounts->member($owner) as $member)
{ {
$member = $member['account_id']; $member = $member['account_id'];
if (!$this->bo->check_perms(EGW_ACL_READ,0,$member)) if (!$this->bo->check_perms(EGW_ACL_READ|EGW_ACL_READ_FOR_PARTICIPANTS,0,$member))
{ {
$no_access_group[$member] = $this->bo->participant_name($member); $no_access_group[$member] = $this->bo->participant_name($member);
} }
} }
} }
elseif (!$this->bo->check_perms(EGW_ACL_READ,0,$owner)) elseif (!$this->bo->check_perms(EGW_ACL_READ|EGW_ACL_READ_FOR_PARTICIPANTS,0,$owner))
{ {
$no_access[$owner] = $this->bo->participant_name($owner); $no_access[$owner] = $this->bo->participant_name($owner);
} }