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

Fix rubocop formatting issues

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