Skip to content

Conversation

@Mary-Clb
Copy link

Checklist before requesting a review

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

It fixes !40229
Saved searches were no longer accessible for users with simplified interface, while they were available in version 10. This fix restores the ability to access and save search queries for helpdesk users.

Technical Changes

Modified Files:

  1. Profile.php

Added bookmark_public to $helpdesk_rights array
Added SavedSearch to tools section in getRightsForForm() for helpdesk interface

  1. SavedSearchFormController.php

Added security strategy imports (Firewall, SecurityStrategy)
Changed security strategy from default STRATEGY_CENTRAL_ACCESS to STRATEGY_AUTHENTICATED
This allows both central and helpdesk interface users to access the controller

@Mary-Clb Mary-Clb self-assigned this Nov 20, 2025
@Mary-Clb Mary-Clb added the bug label Nov 20, 2025
Copy link
Contributor

@AdrienClairembault AdrienClairembault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested it quickly and there are a few issues:

1) The save saved search button is still shown in the search UI even if the user does not have the new right:

Image

So, the user will still get the error page in the case.
It would be better to not add the button if the user can't use the searches.

2) I can only save a search if I check the "READ" right (not "CREATE", which seems to do nothing.)

3) I can see saved searches on other types:

Image

I think on self service only the ticket tab should be shown, here "aaaa" is a saved search on computer so I get an error if I click it.

4) And finally, do we need really need a configurable right for this? ping @orthagh
I don't know how it worked on GLPI 10 but I don't see why you would prevent an user from creating saved searches.

@cconard96
Copy link
Contributor

AFAIK, everyone should always be able to create private saved searches (no rights associated) while public saved searches were only available in the standard interface.

@Mary-Clb
Copy link
Author

Please let me know if these modifications are better :

  • SavedSearch.php: Added canView() method override to allow access in helpdesk interface for private searches
  • Profile.php: Remove saved search right configuration from helpdesk interface rights

Copy link
Contributor

@AdrienClairembault AdrienClairembault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just one small detail:

When I save a search, I am redirected to this page:

Image

On GLPI 10, I would instead be redirected to the current search page, which seems more logical.

Image

To achieve this, I think you'll need to override the getPostFormAction() method and make sure it returns back if the user is a self service user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants