diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-21 04:40:56 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-06 00:54:22 +0300 |
commit | 7735ef86f0714a5b2a4cb4db8ec0471654563885 (patch) | |
tree | 5f56b0348da8870736339150b669069f84e43fd1 /lib/gitlab/protocol_access.rb | |
parent | ea9d910c8bd2774cf48a5b6092704143a7505011 (diff) |
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 |