Commit 0002114e authored by Jonathan Schafer's avatar Jonathan Schafer

Fix rubocop formatting issues

parent 9765f172
......@@ -35,6 +35,7 @@ module API
get ':id' do
vulnerability = find_and_authorize_vulnerability!(:read_vulnerability)
break not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project)
render_vulnerability(vulnerability)
end
......@@ -44,6 +45,7 @@ module API
post ':id/resolve' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability)
break not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project)
break not_modified! if vulnerability.resolved?
vulnerability = ::Vulnerabilities::ResolveService.new(current_user, vulnerability).execute
......@@ -56,6 +58,7 @@ module API
post ':id/dismiss' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability)
break not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project)
break not_modified! if vulnerability.dismissed?
vulnerability = ::Vulnerabilities::DismissService.new(current_user, vulnerability).execute
......@@ -68,6 +71,7 @@ module API
post ':id/confirm' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability)
break not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project)
break not_modified! if vulnerability.confirmed?
vulnerability = ::Vulnerabilities::ConfirmService.new(current_user, vulnerability).execute
......@@ -87,6 +91,7 @@ module API
end
get ':id/vulnerabilities' do
break not_found! unless Feature.enabled?(:first_class_vulnerabilities, user_project)
authorize! :read_vulnerability, user_project
vulnerabilities = paginate(
......@@ -104,6 +109,7 @@ module API
end
post ':id/vulnerabilities' do
break not_found! unless Feature.enabled?(:first_class_vulnerabilities, user_project)
authorize! :create_vulnerability, user_project
vulnerability = ::Vulnerabilities::CreateService.new(
......
......@@ -52,6 +52,7 @@ module API
post ':id/issue_links' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability_issue_link)
break not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project)
issue = find_project_issue(params[:target_issue_iid], vulnerability.project_id)
response = ::VulnerabilityIssueLinks::CreateService.new(
......@@ -69,6 +70,7 @@ module API
delete ':id/issue_links/:issue_link_id' do
vulnerability = find_and_authorize_vulnerability!(:admin_vulnerability_issue_link)
break not_found! unless Feature.enabled?(:first_class_vulnerabilities, vulnerability.project)
issue_link = find_issue_link!
service_response = ::VulnerabilityIssueLinks::DeleteService.new(current_user, issue_link).execute
......
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