Add managing protected branches as custom permission
What does this MR do and why?
It adds managing protected branches as a custom permission. This MR depends on !152152 (merged), tests will be failing until that one is merged.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screen_Recording_2024-05-06_at_9.28.30
How to set up and validate locally
- Pick a project and a user who is max developer of that project
- Go to the project repository settgins, eg. http://gdk.test:3000/flightjs/Flight/-/settings/repository - you should get 404.
- Create a new custom role that enables managing protected branches (you can do it in admin interface, if you are on self-managed, eg. http://gdk.test:3000/admin/application_settings/roles_and_permissions)
- Visit any group or project member pages such as
http://gdk.test:3000/flightjs/Flight/-/project_members
- Assign the created custom role to the selected user
- Log in as the selected user
- Go to the project page, you should be able to access Settings - Repository and then see only protected branches section. Play around with protected branches.
- You should be able to access also protected branches API endpoints
Related to #448823
Edited by Jarka Košanová