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:
authorDouwe Maan <douwe@selenight.nl>2018-12-20 19:40:56 +0300
committerDouwe Maan <douwe@selenight.nl>2019-01-02 17:31:32 +0300
commit3a0ae96c0e10154c93e5160b4ee239a5d198d282 (patch)
treef5f9bca1916f497542f2d52d5f053f9ced1d5bb3 /lib/gitlab/git_access_wiki.rb
parent551e84c2cb5bf9a0bd8c339b012d60607383fb3e (diff)
Don't run single change checks when changes are unknown
When the `changes` passed to `GitAccess` are the literal string `_any`, which indicates that this is a pre-authorization check, we now check whether the user can push to any branch in the project in question, instead of running the per-change check with `oldrev` `_any`, `newrev` `nil`, and `ref` `nil`.
Diffstat (limited to 'lib/gitlab/git_access_wiki.rb')
-rw-r--r--lib/gitlab/git_access_wiki.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/git_access_wiki.rb b/lib/gitlab/git_access_wiki.rb
index 3f24001e4ee..0af91957fa8 100644
--- a/lib/gitlab/git_access_wiki.rb
+++ b/lib/gitlab/git_access_wiki.rb
@@ -15,7 +15,7 @@ module Gitlab
authentication_abilities.include?(:download_code) && user_access.can_do_action?(:download_wiki_code)
end
- def check_single_change_access(change, _options = {})
+ def check_change_access!
unless user_access.can_do_action?(:create_wiki)
raise UnauthorizedError, ERROR_MESSAGES[:write_to_wiki]
end