Commit 1daf191e authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'sy-update-am-permission' into 'master'

Expose correct permission for alert management

See merge request gitlab-org/gitlab!35448
parents 42a71c07 e7557619
...@@ -7,7 +7,7 @@ module Projects::AlertManagementHelper ...@@ -7,7 +7,7 @@ module Projects::AlertManagementHelper
'enable-alert-management-path' => edit_project_service_path(project, AlertsService), 'enable-alert-management-path' => edit_project_service_path(project, AlertsService),
'populating-alerts-help-url' => help_page_url('user/project/operations/alert_management.html', anchor: 'enable-alert-management'), 'populating-alerts-help-url' => help_page_url('user/project/operations/alert_management.html', anchor: 'enable-alert-management'),
'empty-alert-svg-path' => image_path('illustrations/alert-management-empty-state.svg'), 'empty-alert-svg-path' => image_path('illustrations/alert-management-empty-state.svg'),
'user-can-enable-alert-management' => can?(current_user, :admin_project, project).to_s, 'user-can-enable-alert-management' => can?(current_user, :admin_operations, project).to_s,
'alert-management-enabled' => alert_management_enabled?(project).to_s 'alert-management-enabled' => alert_management_enabled?(project).to_s
} }
end end
......
...@@ -19,7 +19,7 @@ RSpec.describe Projects::AlertManagementHelper do ...@@ -19,7 +19,7 @@ RSpec.describe Projects::AlertManagementHelper do
before do before do
allow(helper) allow(helper)
.to receive(:can?) .to receive(:can?)
.with(current_user, :admin_project, project) .with(current_user, :admin_operations, project)
.and_return(user_can_enable_alert_management) .and_return(user_can_enable_alert_management)
end end
......
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