diff options
| author | Nick Thomas <nick@gitlab.com> | 2018-02-23 15:36:40 +0000 |
|---|---|---|
| committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-05 20:47:42 +0200 |
| commit | 287c34ca1f9af4e395493c99623af8437f82d919 (patch) | |
| tree | a2748dc20c4a159d93564a42dddec7e768e22a43 /lib | |
| parent | 9c6c17cbcdb8bf8185fc1b873dcfd08f723e4df5 (diff) | |
| download | gitlab-ce-287c34ca1f9af4e395493c99623af8437f82d919.tar.gz | |
Convert from GraphQL::Batch to BatchLoader
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/graphql/authorize.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/gitlab/graphql/authorize.rb b/lib/gitlab/graphql/authorize.rb index 1df130e519a..6f9de8c38b7 100644 --- a/lib/gitlab/graphql/authorize.rb +++ b/lib/gitlab/graphql/authorize.rb @@ -47,6 +47,8 @@ module Gitlab def build_checker(current_user, abilities) proc do |obj| + # Load the elements if they weren't loaded by BatchLoader yet + obj = obj.sync if obj.respond_to?(:sync) obj if abilities.all? { |ability| Ability.allowed?(current_user, ability, obj) } end end |
