diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php index 6b364e9bc8..9eebb7ac72 100644 --- a/pandora_console/include/functions_events.php +++ b/pandora_console/include/functions_events.php @@ -1083,6 +1083,19 @@ function events_get_all( $tag_without = base64_decode($filter['tag_without']); $tags = json_decode($tag_without, true); if (is_array($tags) && !in_array('0', $tags)) { + if (!$user_is_admin) { + $user_tags = array_flip(tags_get_tags_for_module_search()); + if ($user_tags != null) { + foreach ($tags as $key_tag => $id_tag) { + // User cannot filter with those tags. + if (!array_search($id_tag, $user_tags)) { + unset($tags[$key_tag]); + continue; + } + } + } + } + foreach ($tags as $id_tag) { if (!isset($tags_names[$id_tag])) { $tags_names[$id_tag] = tags_get_name($id_tag);