diff options
author | Valery Sizov <vsv2711@gmail.com> | 2014-11-14 13:46:51 +0200 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2014-11-14 13:46:51 +0200 |
commit | 80f5af48e2c66c3f61218f9c7e85f74c634ea8df (patch) | |
tree | 743748dd5efa7651e06b131ca65a190f4f9f9d46 /lib/gitlab_access.rb | |
parent | dbdcc5f400df466944ad5e55e8e03dee55de865f (diff) | |
download | gitlab-shell-80f5af48e2c66c3f61218f9c7e85f74c634ea8df.tar.gz |
Show error message when git access is rejected
Diffstat (limited to 'lib/gitlab_access.rb')
-rw-r--r-- | lib/gitlab_access.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb index 78d353c..547b81d 100644 --- a/lib/gitlab_access.rb +++ b/lib/gitlab_access.rb @@ -1,5 +1,6 @@ require_relative 'gitlab_init' require_relative 'gitlab_net' +require_relative 'gitlab_access_status' require_relative 'names_helper' require 'json' @@ -17,13 +18,14 @@ class GitlabAccess end def exec - if api.allowed?('git-receive-pack', @repo_name, @actor, @changes) - return true + status = api.check_access('git-receive-pack', @repo_name, @actor, @changes) + if status.allowed? + true else # reset GL_ID env since we stop git push here ENV['GL_ID'] = nil - puts "GitLab: You are not allowed to access some of the refs!" - return false + puts "GitLab: #{status.message}" + false end end |