debian-mirror-gitlab/app/services/incident_management/link_alerts/base_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
571 B
Ruby
Raw Normal View History

2023-03-04 22:38:38 +05:30
# frozen_string_literal: true
module IncidentManagement
module LinkAlerts
class BaseService < ::BaseProjectService
private
attr_reader :incident
def allowed?
current_user&.can?(:admin_issue, project)
end
def success
ServiceResponse.success(payload: { incident: incident })
end
def error(message)
ServiceResponse.error(message: message)
end
def error_no_permissions
error(_('You have insufficient permissions to manage alerts for this project'))
end
end
end
end