diff options
Diffstat (limited to 'app/graphql/resolvers/codequality_reports_comparer_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/codequality_reports_comparer_resolver.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/graphql/resolvers/codequality_reports_comparer_resolver.rb b/app/graphql/resolvers/codequality_reports_comparer_resolver.rb new file mode 100644 index 00000000000..1c034887c0d --- /dev/null +++ b/app/graphql/resolvers/codequality_reports_comparer_resolver.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Resolvers + class CodequalityReportsComparerResolver < BaseResolver + include Gitlab::Graphql::Authorize::AuthorizeResource + + type ::Types::Security::CodequalityReportsComparerType, null: true + + authorize :read_build + + def resolve + return unless Feature.enabled?(:sast_reports_in_inline_diff, object.project) + + authorize!(object.actual_head_pipeline) + + object.compare_codequality_reports + end + end +end |