diff options
author | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2021-03-31 19:41:24 +0300 |
---|---|---|
committer | GitLab Release Tools Bot <delivery-team+release-tools@gitlab.com> | 2021-03-31 19:41:24 +0300 |
commit | 38b3003b67db3f2eadfa81fd28b13d168f665766 (patch) | |
tree | be836d10a991163527d2e349ff1e770276ecbea2 /lib | |
parent | b2ce3643e27db4cc0ad30cc09d651c00ec799887 (diff) | |
parent | c93927607f55350f2e2af4bdaf03ff9dba80ab1d (diff) |
Merge remote-tracking branch 'dev/13-10-stable' into 13-10-stable
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/system_hooks.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/markdown_cache.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/user_access.rb | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/lib/api/system_hooks.rb b/lib/api/system_hooks.rb index 42e16d47a0b..fe23a111b7f 100644 --- a/lib/api/system_hooks.rb +++ b/lib/api/system_hooks.rb @@ -47,7 +47,7 @@ module API params do requires :id, type: Integer, desc: 'The ID of the system hook' end - get ":id" do + post ":id" do hook = SystemHook.find(params[:id]) data = { event_name: "project_create", diff --git a/lib/gitlab/markdown_cache.rb b/lib/gitlab/markdown_cache.rb index 36e9a6ccef6..3ec5f2339b5 100644 --- a/lib/gitlab/markdown_cache.rb +++ b/lib/gitlab/markdown_cache.rb @@ -3,7 +3,7 @@ module Gitlab module MarkdownCache # Increment this number every time the renderer changes its output - CACHE_COMMONMARK_VERSION = 26 + CACHE_COMMONMARK_VERSION = 27 CACHE_COMMONMARK_VERSION_START = 10 BaseError = Class.new(StandardError) diff --git a/lib/gitlab/user_access.rb b/lib/gitlab/user_access.rb index 0af7ad6ec17..a4a1cccf9d5 100644 --- a/lib/gitlab/user_access.rb +++ b/lib/gitlab/user_access.rb @@ -11,10 +11,11 @@ module Gitlab attr_reader :user, :push_ability attr_accessor :container - def initialize(user, container: nil, push_ability: :push_code) + def initialize(user, container: nil, push_ability: :push_code, skip_collaboration_check: false) @user = user @container = container @push_ability = push_ability + @skip_collaboration_check = skip_collaboration_check end def can_do_action?(action) @@ -87,6 +88,8 @@ module Gitlab private + attr_reader :skip_collaboration_check + def can_push? user.can?(push_ability, container) end @@ -98,6 +101,8 @@ module Gitlab end def branch_allows_collaboration_for?(ref) + return false if skip_collaboration_check + # Checking for an internal project or group to prevent an infinite loop: # https://gitlab.com/gitlab-org/gitlab/issues/36805 (!project.internal? && project.branch_allows_collaboration?(user, ref)) |