summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorSasha Joseph <sasha@fuzzproductions.com>2014-07-28 01:01:01 -0400
committerSasha Joseph <sasha@fuzzproductions.com>2014-07-28 12:48:13 -0400
commit37c4ba6f8d8b6be9f15bd0df701c64eea9c4d8e4 (patch)
treeecdc0db00ff1f15d49cc7456fd3d4ce17bf7f881 /lib/api/helpers.rb
parent00c6723883671769f6efd692f935dc3203d7ccc6 (diff)
downloadgitlab-ce-37c4ba6f8d8b6be9f15bd0df701c64eea9c4d8e4.tar.gz
Add an option to GET /projects in the GitLab API to exclude archived projects
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index d7d209e16f7..8189e433789 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -5,6 +5,10 @@ module API
SUDO_HEADER ="HTTP_SUDO"
SUDO_PARAM = :sudo
+ def parse_boolean(value)
+ [ true, 1, '1', 't', 'T', 'true', 'TRUE', 'on', 'ON' ].include?(value)
+ end
+
def current_user
private_token = (params[PRIVATE_TOKEN_PARAM] || env[PRIVATE_TOKEN_HEADER]).to_s
@current_user ||= User.find_by(authentication_token: private_token)