Closed Phorms closed 2 years ago
This should be fixed by #12692
Hi,
thanks for your quick response, but the fix does not fix the issue.
The SQL query gets shorter, but is missing any user filter.
SELECT glpi_savedsearches.*, glpi_savedsearches_users.id AS is_default FROM glpi_savedsearches
LEFT JOIN glpi_savedsearches_users ON (glpi_savedsearches_users.savedsearches_id = glpi_savedsearches.id)
WHERE glpi_savedsearches.itemtype = 'Ticket' ORDER BY itemtype, name
+ self::getVisibilityCriteria();
could add the user filter, but Session::haveRight('config', UPDATE)
skips that filter.
Maybe this is usefull for admins in the saved searches overview (/front/savedsearch.php), but not if you want to see only your own saved searches under "Lists".
Removing
if (Session::haveRight('config', UPDATE)) { return $criteria; }
in src/SavedSearch.php under the function public static function getVisibilityCriteria(bool $forceall = false): array
(line 1327 - 1332) solves my issue. Maybe with unpredictable side effects, but the lists now contains only my own and public saved searches.
Code of Conduct
Is there an existing issue for this?
Version
10.0.3
Bug description
Expected behavior: Only your own and all plublic saved searches of the current category (tickets, assets, ...) are visible.
Current behavior: All saved searches of the current category (tickets, assets, ...) are visible. The private / public option has no impact.
User permissions seems not to affect this behavior. I'm unaware of any settings that could affect the saved search. I disabled all plugins, no change.
The system was updated from version 9.5.4 where the filter worked correctly.
Adding a new saved search entry does not create a new entry in the database table "glpi_savedsearches_users". Only a entry in "glpi_savedsearches" is created.
All three entries are from different users and private.
But, I'm able to see them.
The SQL query received on our SQL server (no filter for 'is_private' field)
SELECT glpi_savedsearches.*, glpi_savedsearches_users.id AS is_default FROM glpi_savedsearches LEFT JOIN glpi_savedsearches_users ON (glpi_savedsearches_users.savedsearches_id = glpi_savedsearches.id AND glpi_savedsearches.itemtype = glpi_savedsearches_users.itemtype AND glpi_savedsearches_users.users_id = '9') WHERE (glpi_savedsearches.itemtype = 'Ticket') ORDER BY itemtype, name
Hope that helps.
Relevant log output
Page URL
/front/ticket.php
Steps To reproduce
Your GLPI setup information
Information about system installation and configuration
Server
GLPI constants
Libraries
SQL replicas
Plugins list
I disabled all plugins. The problem did not change.Anything else?
No response