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

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

module Gitlab
  module Graphql
    module ExposePermissions
      extend ActiveSupport::Concern
      prepended do
        def self.expose_permissions(permission_type, description: 'Permissions for the current user on the resource')
          field :user_permissions, permission_type,
                description: description,
                null: false,
                method: :itself
        end
      end
    end
  end
end