phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: calendar/inc class.bocalendar.inc.php,1.71.2.32


From: Ralf Becker <address@hidden>
Subject: [Phpgroupware-cvs] CVS: calendar/inc class.bocalendar.inc.php,1.71.2.32,1.71.2.33
Date: Fri, 07 Mar 2003 15:13:22 -0500

Update of /cvsroot/phpgroupware/calendar/inc
In directory subversions:/tmp/cvs-serv9063

Modified Files:
      Tag: Version-0_9_14-branch
        class.bocalendar.inc.php 
Log Message:
Fixed check_perms to give all participants of an event (or people haveing 
read-grants from them) at least read-access to the event.
Fix for GNU Bug #2387


Index: class.bocalendar.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/calendar/inc/class.bocalendar.inc.php,v
retrieving revision 1.71.2.32
retrieving revision 1.71.2.33
diff -C2 -r1.71.2.32 -r1.71.2.33
*** class.bocalendar.inc.php    27 Feb 2003 22:27:21 -0000      1.71.2.32
--- class.bocalendar.inc.php    7 Mar 2003 20:12:42 -0000       1.71.2.33
***************
*** 1168,1171 ****
--- 1168,1173 ----
                @param $event event as array or the event-id or 0 for general 
check
                @param $other uid to check (if event==0) or 0 to check against 
$this->owner
+               @note Participating in an event is considered as haveing 
read-access on that event, \
+                       even if you have no general read-grant from that user.
                */
                function check_perms($needed,$event=0,$other=0)
***************
*** 1190,1193 ****
--- 1192,1209 ----
                        $user = $GLOBALS['phpgw_info']['user']['account_id'];
                        $grants = $this->grants[$owner];
+                       
+                       if (is_array($event) && $needed == PHPGW_ACL_READ)
+                       {
+                               // Check if the $user is one of the 
participants or has a read-grant from one of them
+                               //
+                               foreach($event['participants'] as $uid => 
$accept)
+                               {
+                                       if ($this->grants[$uid] & 
PHPGW_ACL_READ || $uid == $user)
+                                       {
+                                               $grants |= PHPGW_ACL_READ;
+                                               break;
+                                       }
+                               }
+                       }
  
                        if ($GLOBALS['phpgw']->accounts->get_type($owner) == 
'g' && $needed == PHPGW_ACL_ADD)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]