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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/graphql/expose_permissions.rb')
-rw-r--r--lib/gitlab/graphql/expose_permissions.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/graphql/expose_permissions.rb b/lib/gitlab/graphql/expose_permissions.rb
index ab9ed354673..070d3c188a4 100644
--- a/lib/gitlab/graphql/expose_permissions.rb
+++ b/lib/gitlab/graphql/expose_permissions.rb
@@ -5,11 +5,15 @@ module Gitlab
module ExposePermissions
extend ActiveSupport::Concern
prepended do
- def self.expose_permissions(permission_type, description: 'Permissions for the current user on the resource')
+ 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
+ method: :itself,
+ &block
end
end
end