From da800182cbe150850b731e00d900ef3b15282a1c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 20 Mar 2013 11:06:23 +0000 Subject: [PATCH] * Projectmanager: showing again global categories and their color from all apps, do no remove datasource category when element get stored and no category is selected --- phpgwapi/inc/class.categories.inc.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.categories.inc.php b/phpgwapi/inc/class.categories.inc.php index db98aa5453..9a17d0e3ca 100644 --- a/phpgwapi/inc/class.categories.inc.php +++ b/phpgwapi/inc/class.categories.inc.php @@ -488,7 +488,7 @@ class categories { foreach($cat_arr as $id=>$cat_id) { - if (!$this->check_perms($needed, $cat_id)) + if (!$this->check_perms($needed, $cat_id, false, $needed == EGW_ACL_READ)) // allow reading all global cats { unset($cat_arr[$id]); } @@ -507,9 +507,10 @@ class categories * @param int $needed necessary ACL right: EGW_ACL_{READ|EDIT|DELETE} * @param mixed $category category as array or the category_id * @param boolean $no_acl_check=false if true, grants are NOT checked, gives access to all non-private categories of all users + * @param boolean $allow_global_read if true, global cats are allowed (independent of app) for reading * @return boolean true permission granted, false for permission denied, null for category does not exist */ - public function check_perms($needed, $category, $no_acl_check=false) + public function check_perms($needed, $category, $no_acl_check=false, $allow_global_read=false) { if (!is_array($category) && !($category = self::read($category))) { @@ -525,9 +526,10 @@ class categories } // Read access to global categories - if ($needed == EGW_ACL_READ && (array_intersect(explode(',',$category['owner']),$this->global_owners) || + if ($needed == EGW_ACL_READ && (($is_global=array_intersect(explode(',',$category['owner']),$this->global_owners)) || $no_acl_check && $category['access'] == 'public') && // no_acl_check only means public cats - ($category['appname'] == self::GLOBAL_APPNAME || $category['appname'] == $this->app_name)) + ($category['appname'] == self::GLOBAL_APPNAME || $category['appname'] == $this->app_name || + $is_global && $allow_global_read)) { //echo "

".__METHOD__."($needed,$category[name]) access because global via memberships

\n"; return true;