diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 03:09:33 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 03:09:33 +0300 |
commit | b56027c9d80ac0e297ba8a43c81e8504172dbf9f (patch) | |
tree | b85f743277145e930ae195664655d696e6e0a7fc /lib/gitlab/git_access_snippet.rb | |
parent | 7915c41e4261719719e791602c8235574157164c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/git_access_snippet.rb')
-rw-r--r-- | lib/gitlab/git_access_snippet.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/gitlab/git_access_snippet.rb b/lib/gitlab/git_access_snippet.rb index e11c1ea527c..d05ffe9b508 100644 --- a/lib/gitlab/git_access_snippet.rb +++ b/lib/gitlab/git_access_snippet.rb @@ -14,6 +14,8 @@ module Gitlab attr_reader :snippet + alias_method :container, :snippet + def initialize(actor, snippet, protocol, **kwargs) @snippet = snippet @@ -53,11 +55,6 @@ module Gitlab check_change_access! end - override :repository - def repository - snippet&.repository - end - def check_snippet_accessibility! if snippet.blank? raise NotFoundError, ERROR_MESSAGES[:snippet_not_found] @@ -89,11 +86,15 @@ module Gitlab raise ForbiddenError, ERROR_MESSAGES[:update_snippet] end + check_size_before_push! + changes_list.each do |change| # If user does not have access to make at least one change, cancel all # push by allowing the exception to bubble up check_single_change_access(change) end + + check_push_size! end def check_single_change_access(change) |