Skip to content

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
Screenshot_2023-01-10_at_2.56.43_PM Screenshot_2023-01-10_at_2.58.45_PM

How to set up and validate locally

  1. Create a new public project
  2. Go to Settings => CI/CD
  3. Disable Auto/Devops setting
  4. 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.
  5. Login as that user
  6. Go to the repository view
  7. Notice that you cannot see the `CI/CD button
  8. Logout
  9. Login as the admin
  10. Go to the repository
  11. 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.

Related to #343339 (closed)

Edited by Frédéric Caplette

Merge request reports