Commit e7557619 authored by syasonik's avatar syasonik

Expose correct permission for alert management

parent 8e1be747
...@@ -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