freebussy ACL added into calender. Now if you only give that right, you will see, that the time is blocked without a read right of user or group. But will see everything as private

This commit is contained in:
Stefan Becker 2009-06-09 12:16:15 +00:00
parent 8cd899c36c
commit 78ce775f17
6 changed files with 151 additions and 146 deletions

View File

@ -24,6 +24,7 @@ define('WEEK_s',7*DAY_s);
* Used be the addressbook. * Used be the addressbook.
*/ */
define('EGW_ACL_READ_FOR_PARTICIPANTS',EGW_ACL_CUSTOM_1); define('EGW_ACL_READ_FOR_PARTICIPANTS',EGW_ACL_CUSTOM_1);
define('EGW_ACL_FREEBUSY',EGW_ACL_CUSTOM_2);
/** /**
* Required (!) include, as we use the MCAL_* constants, BEFORE instanciating (and therefore autoloading) the class * Required (!) include, as we use the MCAL_* constants, BEFORE instanciating (and therefore autoloading) the class
@ -303,7 +304,7 @@ class calendar_bo
$users = array(); $users = array();
foreach($params['users'] as $user) foreach($params['users'] as $user)
{ {
if ($params['ignore_acl'] || $this->check_perms(EGW_ACL_READ|EGW_ACL_READ_FOR_PARTICIPANTS,0,$user)) if ($params['ignore_acl'] || $this->check_perms(EGW_ACL_READ|EGW_ACL_READ_FOR_PARTICIPANTS|EGW_ACL_FREEBUSY,0,$user))
{ {
if ($user && !in_array($user,$users)) // already added? if ($user && !in_array($user,$users)) // already added?
{ {
@ -327,7 +328,7 @@ class calendar_bo
{ {
// use only members which gave the user a read-grant // use only members which gave the user a read-grant
if (!in_array($member['account_id'],$users) && if (!in_array($member['account_id'],$users) &&
($params['ignore_acl'] || $this->check_perms(EGW_ACL_READ,0,$member['account_id']))) ($params['ignore_acl'] || $this->check_perms(EGW_ACL_READ|EGW_ACL_FREEBUSY,0,$member['account_id'])))
{ {
$users[] = $member['account_id']; $users[] = $member['account_id'];
} }
@ -977,7 +978,6 @@ class calendar_bo
if ($other && !is_numeric($other)) if ($other && !is_numeric($other))
{ {
$resource = $this->resource_info($other); $resource = $this->resource_info($other);
return $needed & $resource['rights']; return $needed & $resource['rights'];
} }
if (is_int($event) && $event == 0) if (is_int($event) && $event == 0)
@ -1003,7 +1003,6 @@ class calendar_bo
} }
$user = $GLOBALS['egw_info']['user']['account_id']; $user = $GLOBALS['egw_info']['user']['account_id'];
$grants = $this->grants[$owner]; $grants = $this->grants[$owner];
if (is_array($event) && $needed == EGW_ACL_READ) if (is_array($event) && $needed == EGW_ACL_READ)
{ {
// Check if the $user is one of the participants or has a read-grant from one of them // Check if the $user is one of the participants or has a read-grant from one of them
@ -1016,7 +1015,7 @@ class calendar_bo
if ($uid == $user || $uid < 0 && in_array($user,$GLOBALS['egw']->accounts->members($uid,true))) if ($uid == $user || $uid < 0 && in_array($user,$GLOBALS['egw']->accounts->members($uid,true)))
{ {
// if we are a participant, we have an implicite READ and PRIVAT grant // if we are a participant, we have an implicite READ and PRIVAT grant
$grants |= EGW_ACL_READ | EGW_ACL_PRIVATE; $grants |= EGW_ACL_READ;
break; break;
} }
elseif ($this->grants[$uid] & EGW_ACL_READ) elseif ($this->grants[$uid] & EGW_ACL_READ)
@ -1038,7 +1037,6 @@ class calendar_bo
error_log(__METHOD__." no participants for event:".print_r($event,true)); error_log(__METHOD__." no participants for event:".print_r($event,true));
} }
} }
if ($GLOBALS['egw']->accounts->get_type($owner) == 'g' && $needed == EGW_ACL_ADD) if ($GLOBALS['egw']->accounts->get_type($owner) == 'g' && $needed == EGW_ACL_ADD)
{ {
$access = False; // a group can't be the owner of an event $access = False; // a group can't be the owner of an event
@ -1268,6 +1266,7 @@ class calendar_bo
EGW_ACL_EDIT => 'ACL_EDIT', EGW_ACL_EDIT => 'ACL_EDIT',
EGW_ACL_DELETE => 'ACL_DELETE', EGW_ACL_DELETE => 'ACL_DELETE',
EGW_ACL_PRIVATE => 'ACL_PRIVATE', EGW_ACL_PRIVATE => 'ACL_PRIVATE',
EGW_ACL_FREEBUSY => 'ACL_FREEBUSY',
); );
for($i = 2; $i < func_num_args(); ++$i) for($i = 2; $i < func_num_args(); ++$i)
{ {

View File

@ -188,13 +188,13 @@ class calendar_ui
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|EGW_ACL_READ_FOR_PARTICIPANTS,0,$member)) if (!$this->bo->check_perms(EGW_ACL_READ|EGW_ACL_READ_FOR_PARTICIPANTS|EGW_ACL_FREEBUSY,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|EGW_ACL_READ_FOR_PARTICIPANTS,0,$owner)) elseif (!$this->bo->check_perms(EGW_ACL_READ|EGW_ACL_READ_FOR_PARTICIPANTS|EGW_ACL_FREEBUSY,0,$owner))
{ {
$no_access[$owner] = $this->bo->participant_name($owner); $no_access[$owner] = $this->bo->participant_name($owner);
} }

View File

@ -65,6 +65,7 @@ csv calendar de CSV
csv-fieldname calendar de CSV-Feldname csv-fieldname calendar de CSV-Feldname
csv-filename calendar de CSV-Dateiname csv-filename calendar de CSV-Dateiname
custom fields common de Benutzerdefinierte Felder custom fields common de Benutzerdefinierte Felder
custom_2 common de freebussy
daily calendar de Täglich daily calendar de Täglich
days calendar de Tage days calendar de Tage
days of the week for a weekly repeated event calendar de Wochentage für wöchentlich wiederholten Termin days of the week for a weekly repeated event calendar de Wochentage für wöchentlich wiederholten Termin
@ -137,6 +138,7 @@ format of event updates calendar de Format der Benachrichtigungen
forward half a month calendar de einen halben Monat weiter forward half a month calendar de einen halben Monat weiter
forward one month calendar de einen Monat weiter forward one month calendar de einen Monat weiter
four days view calendar de Vier-Tagesansicht four days view calendar de Vier-Tagesansicht
freebusy common de Frei/Belegt
freebusy: unknow user '%1', wrong password or not availible to not loged in users !!! calendar de Belegtzeiten: Unbekannter Benutzername '%1', falsches Passwort oder nicht verfügbar für nicht angemeldete Benutzer !!! freebusy: unknow user '%1', wrong password or not availible to not loged in users !!! calendar de Belegtzeiten: Unbekannter Benutzername '%1', falsches Passwort oder nicht verfügbar für nicht angemeldete Benutzer !!!
freetime search calendar de Terminsuche freetime search calendar de Terminsuche
fri calendar de Fr fri calendar de Fr

View File

@ -65,6 +65,7 @@ csv calendar en CSV
csv-fieldname calendar en CSV-Fieldname csv-fieldname calendar en CSV-Fieldname
csv-filename calendar en CSV-Filename csv-filename calendar en CSV-Filename
custom fields common en Custom fields custom fields common en Custom fields
custom_2 common en freebussy
daily calendar en Daily daily calendar en Daily
days calendar en days days calendar en days
days of the week for a weekly repeated event calendar en Days of the week for a weekly repeated event days of the week for a weekly repeated event calendar en Days of the week for a weekly repeated event
@ -137,6 +138,7 @@ format of event updates calendar en Format of event updates
forward half a month calendar en forward half a month forward half a month calendar en forward half a month
forward one month calendar en forward one month forward one month calendar en forward one month
four days view calendar en Four days view four days view calendar en Four days view
freebusy common en Free/Busy
freebusy: unknow user '%1', wrong password or not availible to not loged in users !!! calendar en freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!! freebusy: unknow user '%1', wrong password or not availible to not loged in users !!! calendar en freebusy: Unknow user '%1', wrong password or not availible to not loged in users !!!
freetime search calendar en Freetime Search freetime search calendar en Freetime Search
fri calendar en Fri fri calendar en Fri

View File

@ -1,6 +1,7 @@
<!-- $Id$ --> <!-- $Id$ -->
<tr class="{row_class}"> <tr class="{row_class}">
<td>{user}</td> <td>{user}</td>
<td align="center"><input type="checkbox" name="{custom_2}" value="Y"{custom_2_selected}></td>
<td align="center"><input type="checkbox" name="{read}" value="Y"{read_selected}></td> <td align="center"><input type="checkbox" name="{read}" value="Y"{read_selected}></td>
<td align="center"><input type="checkbox" name="{add}" value="Y"{add_selected}></td> <td align="center"><input type="checkbox" name="{add}" value="Y"{add_selected}></td>
<td align="center"><input type="checkbox" name="{edit}" value="Y"{edit_selected}></td> <td align="center"><input type="checkbox" name="{edit}" value="Y"{edit_selected}></td>

View File

@ -1,5 +1,6 @@
<tr class="th"> <tr class="th">
<td>{string}</td> <td>{string}</td>
<td align="center">{lang_freebusy}</td>
<td align="center">{lang_read}</td> <td align="center">{lang_read}</td>
<td align="center">{lang_add}</td> <td align="center">{lang_add}</td>
<td align="center">{lang_edit}</td> <td align="center">{lang_edit}</td>