Description
The archivedVersions() JQL function is not correctly checking that the current user has BROWSE_PROJECTS permission in the related project for each version. Currently an error is being shown when searching if an archived version exists and a user cannot browse the related project for that version.
Steps to reproduce:
- Create a project (A) and remove the Browse Projects permission for a user
- Create a version in the above project and then archive it
- Create another project (B), but this time grant Browse Projects permission to the user from above step
- Create a version in the above project and then archive it
- Perform a JQL search as the user lacking browse permission, e.g fixVersion in archivedVersions()
Expected behaviour:
- JQL search will succeed and only issues from projects the logged in user can browse will be shown (project B).
Actual behaviour
- JQL search fails and no results are returned, an error is shown: "A value provided by the function 'archivedVersions' is invalid for the field 'fixVersion'"