Welcome to mirror list, hosted at ThFree Co, Russian Federation.

job_token_scope_resolver.rb « ci « resolvers « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7c6aedad1d66ef0700b5cbe7a17fe8e726961761 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Resolvers
  module Ci
    class JobTokenScopeResolver < BaseResolver
      include Gitlab::Graphql::Authorize::AuthorizeResource

      authorize :admin_project
      description 'Container for resources that can be accessed by a CI job token from the current project.'
      type ::Types::Ci::JobTokenScopeType, null: true

      def resolve
        authorize!(object)

        ::Ci::JobToken::Scope.new(object)
      end
    end
  end
end