diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-20 20:40:56 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-05 16:54:22 -0500 |
commit | 7735ef86f0714a5b2a4cb4db8ec0471654563885 (patch) | |
tree | 5f56b0348da8870736339150b669069f84e43fd1 /lib/gitlab/protocol_access.rb | |
parent | ea9d910c8bd2774cf48a5b6092704143a7505011 (diff) | |
download | gitlab-ce-7735ef86f0714a5b2a4cb4db8ec0471654563885.tar.gz |
Only allow Git Access on the allowed protocol
Diffstat (limited to 'lib/gitlab/protocol_access.rb')
-rw-r--r-- | lib/gitlab/protocol_access.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/protocol_access.rb b/lib/gitlab/protocol_access.rb new file mode 100644 index 00000000000..0498a72d4cf --- /dev/null +++ b/lib/gitlab/protocol_access.rb @@ -0,0 +1,13 @@ +module Gitlab + module ProtocolAccess + def self.allowed?(protocol) + if protocol.to_s == 'web' + true + elsif !current_application_settings.enabled_git_access_protocols.present? + true + else + protocol.to_s == current_application_settings.enabled_git_access_protocols + end + end + end +end |