Incorrect alert when accessing Pipeline Schedules page as Guest/Reporter
Summary
When accessing the Pipeline Schedules
page as a Guest or Reporter, an incorrect alert is displayed.
It is incorrect because:
- The user cannot create a pipeline or pipeline schedule.
- The group has not reached its limit
The user receives the alert due to the following response to the GraphQL query:
"projectPlanLimits": {
"ciPipelineSchedules": null
}
And the following comparison statement:
This is because :read_ci_pipeline_schedules_plan_limit
is only enabled if the user can :create_pipeline_schedule
which is given to Developers and above:
- https://gitlab.com/gitlab-org/gitlab/-/blob/59b0b50cbd5aa915245594b7e6e30375ccfc5b37/app/policies/project_policy.rb#L995-997
- https://gitlab.com/gitlab-org/gitlab/-/blob/59b0b50cbd5aa915245594b7e6e30375ccfc5b37/app/policies/project_policy.rb#L538
Related !142717 (merged), !143669 (merged)
Steps to reproduce
- Add a user to a project as a
Guest
orReporter
. - As that user, navigate to the
Pipeline Schedules
page. - Observe the alert.
What is the current bug behavior?
- Incorrect alert is shown.
What is the expected correct behavior?
- Alert is not shown.
- If there are no pipeline schedules, the
Create a new pipeline schedule
button should be hidden or grayed out.