Skip to content

Conversation

@AdrienClairembault
Copy link
Contributor

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.

Description

On GLPI 10, ajax request to /getDropdownValue would return their own assets for self service users.

See on formcreator, logged in as 'post-only':

image image image

This seems to have changed in GLPI 11, possibly by accident while introducing the generic "AssignableItem" trait.
This PR rectify this behavior by:

  • Creating two dedicated getAssignableVisiblityCriteriaForCentral and getAssignableVisiblityCriteriaForHelpdesk methods.
  • The original getAssignableVisiblityCriteria method will call the correct submethod depending on the current interface
  • The getAssignableVisiblityCriteriaForHelpdesk method will return a criteria that will allow the user to see his own items, without right checks as such rights are not available for helpdesk profiles
  • A getOwnAssetsCriteria method was introduced to share logic without duplication between the two new methods.

References

Fix #21509, #21566 and #21502.

@AdrienClairembault
Copy link
Contributor Author

Back to draft, I think I need to take this setting into account too:

image

@AdrienClairembault AdrienClairembault marked this pull request as draft October 27, 2025 07:59
@AdrienClairembault AdrienClairembault marked this pull request as ready for review October 27, 2025 09:10
@cedric-anne cedric-anne merged commit 0685c50 into glpi-project:11.0/bugfixes Oct 27, 2025
10 checks passed
@cedric-anne cedric-anne added this to the 11.0.2 milestone Oct 27, 2025
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.

User forms simplified mode: the user cannot enter the computer name in a form.

3 participants