diff options
author | Michael Kozono <mkozono@gmail.com> | 2017-05-19 22:58:45 +0300 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2017-06-05 15:32:26 +0300 |
commit | 23d37382dabe3f7c7f2e11df2731de8e939e0cab (patch) | |
tree | c0730c393fef5582dfdfdbbd41ad8340a5c5cd45 /lib/gitlab/git_access_wiki.rb | |
parent | 957edb13fdb21e21efbc68fc342209f4b53a66e4 (diff) |
Refactor to let GitAccess errors bubble up
No external behavior change.
This allows `GitHttpController` to set the HTTP status based on the type of error. Alternatively, we could have added an attribute to GitAccessStatus, but this pattern seemed appropriate.
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 dccafd2cae8..4c87482430f 100644 --- a/lib/gitlab/git_access_wiki.rb +++ b/lib/gitlab/git_access_wiki.rb @@ -16,7 +16,7 @@ module Gitlab if user_access.can_do_action?(:create_wiki) build_status_object(true) else - build_status_object(false, ERROR_MESSAGES[:write_to_wiki]) + raise UnauthorizedError, ERROR_MESSAGES[:write_to_wiki] end end end |