Commit 9a6a1f97 authored by Peter Leitzen's avatar Peter Leitzen

Fix operations settings when Pipelines are disabled

Don't rely on read_environment policy but rather admin_operations.
parent 9fc33b59
...@@ -302,7 +302,7 @@ module ProjectsHelper ...@@ -302,7 +302,7 @@ module ProjectsHelper
end end
def settings_operations_available? def settings_operations_available?
can?(current_user, :read_environment, @project) !@project.archived? && can?(current_user, :admin_operations, @project)
end end
def error_tracking_setting_project_json def error_tracking_setting_project_json
......
...@@ -423,7 +423,7 @@ ...@@ -423,7 +423,7 @@
= link_to project_settings_ci_cd_path(@project), title: _('CI / CD') do = link_to project_settings_ci_cd_path(@project), title: _('CI / CD') do
%span %span
= _('CI / CD') = _('CI / CD')
- if !@project.archived? && settings_operations_available? - if settings_operations_available?
= nav_link(controller: [:operations]) do = nav_link(controller: [:operations]) do
= link_to project_settings_operations_path(@project), title: _('Operations'), data: { qa_selector: 'operations_settings_link' } do = link_to project_settings_operations_path(@project), title: _('Operations'), data: { qa_selector: 'operations_settings_link' } do
= _('Operations') = _('Operations')
......
- return unless can?(current_user, :read_environment, @project) - return unless can?(current_user, :admin_operations, @project)
- setting = error_tracking_setting - setting = error_tracking_setting
......
---
title: Fix operations settings when Pipelines are disabled
merge_request: 47062
author:
type: fixed
...@@ -25,7 +25,7 @@ RSpec.describe 'projects/settings/operations/show' do ...@@ -25,7 +25,7 @@ RSpec.describe 'projects/settings/operations/show' do
end end
before_all do before_all do
project.add_reporter(user) project.add_maintainer(user)
end end
before do before do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment