diff options
author | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-04-28 17:10:42 -0300 |
---|---|---|
committer | Alejandro RodrÃguez <alejorro70@gmail.com> | 2017-05-11 12:21:31 -0300 |
commit | ee259653e7a00359740ca36cef606f9c3cc1a7cb (patch) | |
tree | 6f53403454defd386c4455a6a9ffcf052d4c6695 /lib/gitlab_access.rb | |
parent | 1cf14770f3bf5c3255f4c3a8f69ccfab74317fcd (diff) | |
download | gitlab-shell-ee259653e7a00359740ca36cef606f9c3cc1a7cb.tar.gz |
Handle GL_REPOSITORY env variable and use it in api calls
Diffstat (limited to 'lib/gitlab_access.rb')
-rw-r--r-- | lib/gitlab_access.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab_access.rb b/lib/gitlab_access.rb index 1b2a065..3cdeb3e 100644 --- a/lib/gitlab_access.rb +++ b/lib/gitlab_access.rb @@ -10,10 +10,11 @@ class GitlabAccess include NamesHelper - attr_reader :config, :repo_path, :changes, :protocol + attr_reader :config, :gl_repository, :repo_path, :changes, :protocol - def initialize(repo_path, actor, changes, protocol) + def initialize(gl_repository, repo_path, actor, changes, protocol) @config = GitlabConfig.new + @gl_repository = gl_repository @repo_path = repo_path.strip @actor = actor @changes = changes.lines @@ -27,7 +28,7 @@ class GitlabAccess "GIT_OBJECT_DIRECTORY" => ENV["GIT_OBJECT_DIRECTORY"] } - api.check_access('git-receive-pack', @repo_path, @actor, @changes, @protocol, env: env.to_json) + api.check_access('git-receive-pack', @gl_repository, @repo_path, @actor, @changes, @protocol, env: env.to_json) end raise AccessDeniedError, status.message unless status.allowed? |