From bb4d6a9081edeca74d9312c02aedfb405b42871b Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Tue, 5 Nov 2013 12:56:51 +0000 Subject: [PATCH] 2013-11-05 Sergio Martin * include/functions_tags.php: Fix the tags acl check function to be compatible with acl propagation incident #345 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9006 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_tags.php | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index cf899e80b3..8bfb549105 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2013-11-05 Sergio Martin + + * include/functions_tags.php: Fix the tags acl + check function to be compatible with acl propagation + incident #345 + 2013-11-04 Sergio Martin * operation/tree.php: Truncate the name of agents diff --git a/pandora_console/include/functions_tags.php b/pandora_console/include/functions_tags.php index 97b77f373c..0daece071d 100644 --- a/pandora_console/include/functions_tags.php +++ b/pandora_console/include/functions_tags.php @@ -980,7 +980,18 @@ function tags_check_acl($id_user, $id_group, $access, $tags = array()) { if($id_user === false) { $id_user = $config['id_user']; } - + + // Get parents to check in propagate ACL cases + if (!is_array($id_group) && $id_group != 0) { + $id_group = array($id_group); + $group = db_get_row_filter('tgrupo', array('id_grupo' => $id_group)); + $parents = groups_get_parents($group['parent'], true); + + foreach ($parents as $parent) { + $id_group[] = $parent['id_grupo']; + } + } + $acls = tags_get_acl_tags($id_user, $id_group, $access, 'data'); // If there are wrong parameters or fail ACL check, return false