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

as_single, complexity, complexity_multiplier, #current_user, field_options, last, #object, #offset_pagination, requires_argument!, resolver_complexity, #select_result, single, #single?, single_definition_blocks, singular_type, #synchronized_object, when_single

Methods included from Gitlab::Utils::Override

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

Methods included from Gitlab::Graphql::GlobalIDCompatibility

#coerce_global_id_arguments!

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Instance Method Details

#authorized_resource?(project) ⇒ Boolean

Returns:

  • (Boolean)

18
19
20
# File 'app/graphql/resolvers/projects/jira_imports_resolver.rb', line 18

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

#resolve(**args) ⇒ Object


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

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

  project.jira_imports
end