Merge branch 'master' into 10858-build-packages-improvements
[arvados.git] / services / api / app / controllers / arvados / v1 / keep_services_controller.rb
1 class Arvados::V1::KeepServicesController < ApplicationController
2
3   skip_before_filter :find_object_by_uuid, only: :accessible
4   skip_before_filter :render_404_if_no_object, only: :accessible
5
6   def find_objects_for_index
7     # all users can list all keep services
8     @objects = model_class.where('1=1')
9     super
10   end
11
12   def accessible
13     if request.headers['X-External-Client'] == '1'
14       @objects = model_class.where('service_type=?', 'proxy')
15     else
16       @objects = model_class.where(model_class.arel_table[:service_type].not_eq('proxy'))
17     end
18     render_list
19   end
20
21 end