diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-15 14:19:49 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-15 14:19:49 +0000 |
commit | 875728b1184d4524bf96a6de47b329eba7645446 (patch) | |
tree | 9dddb459c3f43bbbd49102ab132cc8ccec999cab /lib/api/namespaces.rb | |
parent | 77e3fab89f633b70a0f805cce94d09304ad893e2 (diff) | |
parent | 27ad882693a1848b17c3841fec72f21a3b9428ee (diff) | |
download | gitlab-ce-875728b1184d4524bf96a6de47b329eba7645446.tar.gz |
Merge branch 'feature/admin_project_transfer' of /home/git/repositories/gitlab/gitlabhq
Diffstat (limited to 'lib/api/namespaces.rb')
-rw-r--r-- | lib/api/namespaces.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/api/namespaces.rb b/lib/api/namespaces.rb new file mode 100644 index 00000000000..3a9ab66957e --- /dev/null +++ b/lib/api/namespaces.rb @@ -0,0 +1,23 @@ +module API + # namespaces API + class Namespaces < Grape::API + before { + authenticate! + authenticated_as_admin! + } + + resource :namespaces do + # Get a namespaces list + # + # Example Request: + # GET /namespaces + get do + @namespaces = Namespace.scoped + @namespaces = @namespaces.search(params[:search]) if params[:search].present? + @namespaces = paginate @namespaces + + present @namespaces, with: Entities::Namespace + end + end + end +end |