Skip to content

Draft: Avoid fetching variable environments if the user has no access

What does this MR do and why?

If a user does not have read access to the environments, then we should avoid fetching them. This is affecting project environments at the moment, so now we add the ability to pass an environment permission query from the parent component to the general ci_shared_variable interface. Then, if the query exist, it will be fired and we will only get the environments if we get the response that the user can read environments.

This removes a bug where we would show an error alert message when user did not have environments read access.

Screenshots or screen recordings

Before After
read_permissions_after

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #298814 (closed)

Edited by Frédéric Caplette

Merge request reports