Commit 1b99ac21 authored by Alex Kalderimis's avatar Alex Kalderimis

Remove dead code

parent 7d1278ad
# frozen_string_literal: true
module Resolvers
module Projects
class JiraImportsResolver < BaseResolver
prepend ::ManualAuthorization
include Gitlab::Graphql::Authorize::AuthorizeResource
type Types::JiraImportType.connection_type, null: true
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
......@@ -2,8 +2,7 @@
module Types
# rubocop: disable Graphql/AuthorizeTypes
# Authorization is at project level for owners or admins,
# so it is added directly to the Resolvers::JiraImportsResolver
# Authorization is at project level for owners or admins
class JiraImportType < BaseObject
graphql_name 'JiraImport'
......
# frozen_string_literal: true
RSpec.shared_examples 'no Jira import data present' do
it 'returns none' do
expect(resolve_imports).to be_empty
end
end
RSpec.shared_examples 'no Jira import access' do
it 'returns nil' do
expect(resolve_imports).to be_nil
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment