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