app/controllers/api_controller/renderer.rb
#
# Helper proc for rendering a collection of type specified.
#
Helper proc for rendering a collection of type specified.
Helper proc for rendering a collection of type specified .
def collection_search(is_subcollection, type, klass)
      res =
        if is_subcollection
          send("#{type}_query_resource", parent_resource_obj)
        elsif by_tag_param
          klass.find_tagged_with(:all => by_tag_param, :ns  => TAG_NAMESPACE)
        else
          klass.all
        end
      miq_expression = filter_param(klass)
      if miq_expression
        sql, _, attrs = miq_expression.to_sql
        res = res.where(sql) if attrs[:supported_by_sql]
      end
      sort_options = sort_params(klass) if res.respond_to?(:reorder)
      res = res.reorder(sort_options) if sort_options.present?
      options = {:user => @auth_user_obj}
      options[:order] = sort_options if sort_options.present?
      options[:offset], options[:limit] = expand_paginate_params if paginate_params?
      options[:filter] = miq_expression if miq_expression
      Rbac.filtered(res, options)
    end
def collection_search ( is_subcollection , type , klass ) res = if is_subcollection send ( "#{type}_query_resource" , parent_resource_obj ) elsif by_tag_param klass . find_tagged_with ( :all => by_tag_param , :ns => TAG_NAMESPACE ) else klass . all end miq_expression = filter_param ( klass ) if miq_expression sql , _ , attrs = miq_expression . to_sql res = res . where ( sql ) if attrs [ :supported_by_sql ] end sort_options = sort_params ( klass ) if res . respond_to? ( :reorder ) res = res . reorder ( sort_options ) if sort_options . present? options = { :user => @auth_user_obj } options [ :order ] = sort_options if sort_options . present? options [ :offset ] , options [ :limit ] = expand_paginate_params if paginate_params? options [ :filter ] = miq_expression if miq_expression Rbac . filtered ( res , options ) end
Helper proc for rendering a collection of type specified.
Helper proc for rendering a collection of type specified .
is_subcollection
<not_specific>
type
<not_specific>
klass
<not_specific>