summaryrefslogtreecommitdiff
path: root/lib/gitlab_net.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab_net.rb')
-rw-r--r--lib/gitlab_net.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb
index 1f27398..e6478ef 100644
--- a/lib/gitlab_net.rb
+++ b/lib/gitlab_net.rb
@@ -6,7 +6,7 @@ require_relative 'gitlab_config'
require_relative 'gitlab_logger'
class GitlabNet
- def check_access(cmd, repo, actor, changes)
+ def allowed?(cmd, repo, actor, changes)
project_name = repo.gsub("'", "")
project_name = project_name.gsub(/\.git\Z/, "")
project_name = project_name.gsub(/\A\//, "")
@@ -26,11 +26,7 @@ class GitlabNet
url = "#{host}/allowed"
resp = post(url, params)
- if resp.code == '200'
- GitAccessStatus.create_from_json(resp.body)
- else
- GitAccessStatus.new(false, "API is not accesible")
- end
+ !!(resp.code == '200' && resp.body == 'true')
end
def discover(key)