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:
authorLin Jen-Shin <godfat@godfat.org>2017-07-04 00:01:05 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-07-04 00:01:05 +0300
commit23bfd8c13c803f4efdb9eaf8e6e3c1ffd17640e8 (patch)
tree03db93cdd953b49d28fbe62da4655dcb0c23af04 /lib/gitlab/user_access.rb
parent24a1f0d833941a30b91813f36d184d3e7c3f7425 (diff)
Consistently check permission for creating pipelines,
updating builds and updating pipelines. We check against being able to merge or push if the ref is protected.
Diffstat (limited to 'lib/gitlab/user_access.rb')
-rw-r--r--lib/gitlab/user_access.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/user_access.rb b/lib/gitlab/user_access.rb
index 3b922da7ced..bb05c474fa2 100644
--- a/lib/gitlab/user_access.rb
+++ b/lib/gitlab/user_access.rb
@@ -48,6 +48,10 @@ module Gitlab
end
end
+ def can_push_or_merge_to_branch?(ref)
+ can_push_to_branch?(ref) || can_merge_to_branch?(ref)
+ end
+
def can_push_to_branch?(ref)
return false unless can_access_git?