2020-03-26 12:07:48 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
module Projects
|
|
|
|
class JiraImportsResolver < BaseResolver
|
2020-11-10 00:08:52 +00:00
|
|
|
type Types::JiraImportType.connection_type, null: true
|
|
|
|
|
2020-03-26 12:07:48 +00:00
|
|
|
include Gitlab::Graphql::Authorize::AuthorizeResource
|
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
|
|
|
def resolve(**args)
|
|
|
|
authorize!(project)
|
|
|
|
|
2020-04-09 12:09:24 +00:00
|
|
|
project.jira_imports
|
2020-03-26 12:07:48 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def authorized_resource?(project)
|
2020-04-14 12:09:26 +00:00
|
|
|
context[:current_user].present? && Ability.allowed?(context[:current_user], :read_project, project)
|
2020-03-26 12:07:48 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|