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:
authorDennis Tang <dtang@gitlab.com>2018-06-21 11:48:25 +0300
committerDennis Tang <dtang@gitlab.com>2018-06-21 11:48:25 +0300
commit0e7f8fd5bd7ed184b8a12039739200065ffa2dbd (patch)
tree07b3c3bbcc0d05848ab7034d2ed32a801f8786b9 /lib/api/entities.rb
parent203d1026008effeeba5c1f98dba768448473f9fe (diff)
parent904cbe0132a1caf0dbb7efb8bdc70398d1d82289 (diff)
Merge remote-tracking branch 'origin/master' into 43446-new-cluster-page-tabs
Diffstat (limited to 'lib/api/entities.rb')
-rw-r--r--lib/api/entities.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 1cc8fcb8408..bb48a86fe9e 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -349,6 +349,10 @@ module API
expose :developers_can_merge do |repo_branch, options|
options[:project].protected_branches.developers_can?(:merge, repo_branch.name)
end
+
+ expose :can_push do |repo_branch, options|
+ Gitlab::UserAccess.new(options[:current_user], project: options[:project]).can_push_to_branch?(repo_branch.name)
+ end
end
class TreeObject < Grape::Entity