diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-07-04 05:01:05 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-07-04 05:01:05 +0800 |
commit | 23bfd8c13c803f4efdb9eaf8e6e3c1ffd17640e8 (patch) | |
tree | 03db93cdd953b49d28fbe62da4655dcb0c23af04 /lib/gitlab/user_access.rb | |
parent | 24a1f0d833941a30b91813f36d184d3e7c3f7425 (diff) | |
download | gitlab-ce-23bfd8c13c803f4efdb9eaf8e6e3c1ffd17640e8.tar.gz |
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.rb | 4 |
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? |