diff options
author | Douwe Maan <douwe@selenight.nl> | 2018-12-20 17:40:56 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2019-01-02 15:31:32 +0100 |
commit | 3a0ae96c0e10154c93e5160b4ee239a5d198d282 (patch) | |
tree | f5f9bca1916f497542f2d52d5f053f9ced1d5bb3 /lib/gitlab/git_access_wiki.rb | |
parent | 551e84c2cb5bf9a0bd8c339b012d60607383fb3e (diff) | |
download | gitlab-ce-3a0ae96c0e10154c93e5160b4ee239a5d198d282.tar.gz |
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.rb | 2 |
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 |