Hide CI/CD config button when no permission to view pipeline editor
What does this MR do and why?
If the user does not have permission to edit the CI/CD config file, then we should not show the CTA to add a config file in the repository view as it leads to a 404 error.
Screenshots or screen recordings
Before | After |
---|---|
![]() |
![]() |
How to set up and validate locally
- Create a new public project
- Go to Settings => CI/CD
- Disable Auto/Devops setting
- Add a new user to the instance, but not the project. The goal is for a user to be able to see the project, but not able to contribute.
- Login as that user
- Go to the repository view
- Notice that you cannot see the `CI/CD button
- Logout
- Login as the admin
- Go to the repository
- Notice that you can see the CI/CD button!
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #343339 (closed)
Edited by Frédéric Caplette