summaryrefslogtreecommitdiff
path: root/lib/api/entities.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 5954aea8041..e000e3e33d0 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -189,13 +189,13 @@ module API
expose :developers_can_push do |repo_branch, options|
project = options[:project]
- access_levels = project.protected_branches.matching(repo_branch.name).map(&:push_access_levels).flatten
+ access_levels = project.protected_branches.access_levels_for_ref(repo_branch.name, :push)
access_levels.any? { |access_level| access_level.access_level == Gitlab::Access::DEVELOPER }
end
expose :developers_can_merge do |repo_branch, options|
project = options[:project]
- access_levels = project.protected_branches.matching(repo_branch.name).map(&:merge_access_levels).flatten
+ access_levels = project.protected_branches.access_levels_for_ref(repo_branch.name, :merge)
access_levels.any? { |access_level| access_level.access_level == Gitlab::Access::DEVELOPER }
end
end