debian-mirror-gitlab/app/graphql/resolvers/projects/jira_imports_resolver.rb
2021-01-30 21:13:34 +05:30

23 lines
543 B
Ruby

# frozen_string_literal: true
module Resolvers
module Projects
class JiraImportsResolver < BaseResolver
type Types::JiraImportType.connection_type, null: true
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