Manual job page: Allow admins to set pipeline variables regardless of project role
What does this MR do and why?
This MR fixes the manual job page to allow admin users to set pipeline variables regardless of their project role. It changes the permission check from being re-implemented in the frontend to using the backend's determination.
Changes overview:
- Removed the
PipelineVariablesPermissionsMixinfrom components and replaced it with a direct inject ofcanSetPipelineVariablesfrom the backend - Updated the
jobs_helper.rbto provide the permission status directly from the backend usingAbility.allowed? - Updated the
manual.rbstatus class to include the pipeline variables message when the user can set pipeline variables (this is a revert to the previous implementation as we don't need to split this text between the backend and frontend anymore).
References
This MR is part of a larger effort to fix the issue where admin users cannot modify pipeline variables unless they have at least developer access to the project. This was caused by a migration in 17.10 that changed project settings from restrict_user_defined_variables: false to restrict_user_defined_variables: true, ci_pipeline_variables_minimum_override_role: :developer.
- Allow admins to set pipeline variables regardle... (#536292 - closed)
- The MR that introduced initial implementation: !183068 (merged)
Screenshots or screen recordings
No visual changes
| User can not set variables | User can set variables |
|---|---|
![]() |
![]() |
![]() |
![]() |
How to set up and validate locally
- Visit a project as admin where the admin is not a member (or has at maximum reporter role)
- Open the CI/CD > Variables Settings and set Minimum role to use pipeline variables to No one allowed
- Open the create pipeline schedule page and observe that the variables section is not present
- Open the CI/CD > Variables Settings and set Minimum role to use pipeline variables to any other option
- Open the create pipeline schedule page and observe that the variables section is present
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #536292 (closed)



