Admin user without permission on protected branch can retry jobs
Summary
Admin user without merge or push permission on protected branch can retry jobs.
This contradicts with the documentation: Pipeline security on protected branches
The following actions are allowed on protected branches only if the user is allowed to merge or push on that specific branch:
- Retry or cancel existing jobs (using the Web UI or pipelines API).
Steps to reproduce
- Have an owner create a project on a GitLab instance; admin user is not added to the project.
- Configure CI file.
- Verify that Instance admins (from version 16.0) are not granted merge or push permission on protected branch.
- Have an admin user retry a job on the pipelines page, it would run.
Example Project
What is the current bug behavior?
Inconsistency in documented and actual behavior on users without permission on protected branch that can retry jobs.
What is the expected correct behavior?
Admin user without permission on protected branch cannot retry jobs.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)