forked from extern/egroupware
Add in this file to check acl
This commit is contained in:
parent
7901f3f256
commit
a82811fffb
31
addressbook/inc/header.inc.php
Normal file
31
addressbook/inc/header.inc.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare - Addressbook *
|
||||
* http://www.phpgroupware.org *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
if(!isset($owner)) { $owner = 0; }
|
||||
|
||||
$grants = $phpgw->acl->get_grants('addressbook');
|
||||
|
||||
if(!isset($owner) || !$owner) {
|
||||
$owner = $phpgw_info['user']['account_id'];
|
||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16;
|
||||
} else {
|
||||
if($grants[$owner]) {
|
||||
$rights = $grants[$owner];
|
||||
if (!($rights & PHPGW_ACL_READ)) {
|
||||
$owner = $phpgw_info['user']['account_id'];
|
||||
$rights = PHPGW_ACL_READ + PHPGW_ACL_ADD + PHPGW_ACL_EDIT + PHPGW_ACL_DELETE + 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user