debian-mirror-gitlab/lib/gitlab/graphql/expose_permissions.rb
2023-03-05 14:24:40 +05:30

21 lines
522 B
Ruby

# 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',
&block)
field :user_permissions, permission_type,
description: description,
null: false,
method: :itself,
&block
end
end
end
end
end