diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 21:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-27 21:09:21 +0300 |
commit | e0fa0638a422c3e20d4423c9bb69d79afc9c7d3d (patch) | |
tree | 9abb3c0706576bbda895fe9539a55556930606e2 /lib/gitlab/git_access_snippet.rb | |
parent | f8d15ca65390475e356b06dedc51e10ccd179f86 (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 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/git_access_snippet.rb b/lib/gitlab/git_access_snippet.rb index ff1af9bede4..3956fc8a483 100644 --- a/lib/gitlab/git_access_snippet.rb +++ b/lib/gitlab/git_access_snippet.rb @@ -28,7 +28,7 @@ module Gitlab # TODO: Investigate if expanding actor/authentication types are needed. # https://gitlab.com/gitlab-org/gitlab/issues/202190 if actor && !actor.is_a?(User) && !actor.instance_of?(Key) - raise UnauthorizedError, ERROR_MESSAGES[:authentication_mechanism] + raise ForbiddenError, ERROR_MESSAGES[:authentication_mechanism] end unless Feature.enabled?(:version_snippets, user) @@ -53,7 +53,7 @@ module Gitlab override :check_push_access! def check_push_access! - raise UnauthorizedError, ERROR_MESSAGES[:update_snippet] unless user + raise ForbiddenError, ERROR_MESSAGES[:update_snippet] unless user check_change_access! end @@ -74,7 +74,7 @@ module Gitlab passed = guest_can_download_code? || user_can_download_code? unless passed - raise UnauthorizedError, ERROR_MESSAGES[:read_snippet] + raise ForbiddenError, ERROR_MESSAGES[:read_snippet] end end @@ -91,7 +91,7 @@ module Gitlab override :check_change_access! def check_change_access! unless user_access.can_do_action?(:update_snippet) - raise UnauthorizedError, ERROR_MESSAGES[:update_snippet] + raise ForbiddenError, ERROR_MESSAGES[:update_snippet] end changes_list.each do |change| |