debian-mirror-gitlab/lib/gitlab/graphql/expose_permissions.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
459 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2018-11-08 19:23:39 +05:30
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,
2021-02-22 17:27:13 +05:30
method: :itself
2018-11-08 19:23:39 +05:30
end
end
end
end
end