2020-04-22 19:07:51 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
module Projects
|
|
|
|
class JiraImportsResolver < BaseResolver
|
2021-01-29 00:20:46 +05:30
|
|
|
type Types::JiraImportType.connection_type, null: true
|
|
|
|
|
2020-04-22 19:07:51 +05:30
|
|
|
include Gitlab::Graphql::Authorize::AuthorizeResource
|
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
|
|
|
def resolve(**args)
|
|
|
|
authorize!(project)
|
|
|
|
|
|
|
|
project.jira_imports
|
|
|
|
end
|
|
|
|
|
|
|
|
def authorized_resource?(project)
|
|
|
|
context[:current_user].present? && Ability.allowed?(context[:current_user], :read_project, project)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|