Update of /cvsroot/egroupware/phpgwapi/inc
In directory sc8-pr-cvs1:/tmp/cvs-serv10751
Modified Files:
Tag: acl
class.acl.inc.php
Log Message:
Add self-looping to inheritance()
Index: class.acl.inc.php
===================================================================
RCS file: /cvsroot/egroupware/phpgwapi/inc/class.acl.inc.php,v
retrieving revision 1.70.2.3
retrieving revision 1.70.2.4
diff -C2 -d -r1.70.2.3 -r1.70.2.4
*** class.acl.inc.php 26 Oct 2003 02:29:32 -0000 1.70.2.3
--- class.acl.inc.php 26 Oct 2003 02:53:40 -0000 1.70.2.4
***************
*** 27,64 ****
define('PHPGW_ACL_DOMAIN',256);
- /*
- 'phpgw_acl' => array(
- 'fd' => array(
- 'acl_appname' => array('type' => 'varchar','precision'
=> '50'),
- 'acl_location' => array('type' => 'varchar','precision'
=> '255'),
- 'acl_account' => array('type' => 'int','precision' =>
'4'),
- 'acl_rights' => array('type' => 'int','precision' =>
'4'),
- 'acl_account_type' => array('type' =>
'char','precision' => '1')
- ),
- 'pk' => array(),
- 'ix' => array(),
- 'fk' => array(),
- 'uc' => array()
- )
- */
-
- /* Sample rights array for account_id 516 where account_id 501 has
given read rights to addressbook data
- account_id 516 is also a member of the groups with account_ids of 10
and 11, but is readonly for group 10.
-
- $sample_rights = array(
- 'addressbook' => array(
- 'run' => PHPGW_ACL_READ,
- '501' => PHPGW_ACL_READ,
- '516' => PHPGW_ACL_PRIVATE
- ),
- 'phpgw_group' => array(
- '10' => PHPGW_ACL_READ
- ),
- 'phpgw_group' => array(
- '11' => PHPGW_ACL_DELETE
- )
- );
- */
-
/* Include file for enhanced access control manipulation and query */
include(PHPGW_API_INC . SEP . 'class.acl_ext.inc.php');
--- 27,30 ----
***************
*** 295,315 ****
if($this->inherits)
{
! $groups = CreateObject('phpgwapi.acl');
! $groups->type = 'g';
! @reset($this->rights['phpgw_group']);
! while(list($group,$group_rights) =
@each($this->rights['phpgw_group']))
{
! if($this->debug)
{
! echo '<br>acl->get_rights
inheriting rights from group: ' . $group;
}
! $groups->account_id = $group;
! $groups->get_all_rights();
! while(list($app,$rights) =
@each($groups->rights))
{
! while(list($loc,$role) =
@each($rights))
{
!
$this->add_right($app,$loc,$role);
!
$this->add_right($app,'inherited',$group);
}
}
--- 261,303 ----
if($this->inherits)
{
! if($recursed)
{
! $group = $app[2];
! $rights = $app[1];
! $app = $app[0];
! while(list($loc,$role) = @each($rights))
{
!
$this->add_right($app,$loc,$role);
!
$this->add_right($app,'inherited',$group);
}
! return;
! }
! else
! {
! $groups = CreateObject('phpgwapi.acl');
! $groups->type = 'g';
! @reset($this->rights['phpgw_group']);
! while(list($group,$group_rights) =
@each($this->rights['phpgw_group']))
{
! if($this->debug)
{
! echo
'<br>acl->inheritance() from group: ' . $group;
! }
! $groups->account_id = $group;
! $groups->get_all_rights();
! while(list($app,$rights) =
@each($groups->rights))
! {
! if($app ==
'phpgw_group')
! {
!
$this->inheritance(array($app,$rights,$group),True);
! }
! else
! {
!
while(list($loc,$role) = @each($rights))
! {
!
$this->add_right($app,$loc,$role);
!
$this->add_right($app,'inherited',$group);
! }
! }
}
}
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
|