2018-11-09 13:39:43 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-06-25 04:59:00 -04:00
|
|
|
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,
|
2020-12-01 07:09:17 -05:00
|
|
|
method: :itself
|
2018-06-25 04:59:00 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|