Class: Resolvers::Projects::JiraImportsResolver

Inherits:
BaseResolver
  • Object
show all
Includes:
Gitlab::Graphql::Authorize::AuthorizeResource
Defined in:
app/graphql/resolvers/projects/jira_imports_resolver.rb

Constant Summary

Constants included from Gitlab::Graphql::Authorize::AuthorizeResource

Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR

Instance Method Summary collapse

Methods included from Gitlab::Graphql::Authorize::AuthorizeResource

#authorize!, #authorized_find!, #find_object, #raise_resource_not_available_error!

Methods inherited from BaseResolver

complexity, complexity_multiplier, #current_user, last, #object, resolver_complexity, #select_result, single, #single?, #synchronized_object

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Instance Method Details

#authorized_resource?(project) ⇒ Boolean

Returns:

  • (Boolean)

16
17
18
# File 'app/graphql/resolvers/projects/jira_imports_resolver.rb', line 16

def authorized_resource?(project)
  context[:current_user].present? && Ability.allowed?(context[:current_user], :read_project, project)
end

#resolve(**args) ⇒ Object


10
11
12
13
14
# File 'app/graphql/resolvers/projects/jira_imports_resolver.rb', line 10

def resolve(**args)
  authorize!(project)

  project.jira_imports
end