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 gen_action_spec_for_resources(cspec, is_subcollection, href, resource)
      target = is_subcollection ? :subresource_actions : :resource_actions
      return [] unless cspec.key?(target)
      cspec[target].each.collect do |method, action_definitions|
        next unless render_actions_for_method(cspec[:methods], method)
        typed_action_definitions = fetch_typed_subcollection_actions(method, is_subcollection) || action_definitions
        typed_action_definitions.each.collect do |action|
          if !action[:disabled] && api_user_role_allows?(action[:identifier]) && action_validated?(resource, action)
            {"name" => action[:name], "method" => method, "href" => href}
          end
        end
      end.flatten.compact
    end
def gen_action_spec_for_resources ( cspec , is_subcollection , href , resource ) target = is_subcollection ? :subresource_actions : :resource_actions return [ ] unless cspec . key? ( target ) cspec [ target ] . each . collect do | method , action_definitions | next unless render_actions_for_method ( cspec [ :methods ] , method ) typed_action_definitions = fetch_typed_subcollection_actions ( method , is_subcollection ) || action_definitions typed_action_definitions . each . collect do | action | if ! action [ :disabled ] && api_user_role_allows? ( action [ :identifier ] ) && action_validated? ( resource , action ) { "name" => action [ :name ] , "method" => method , "href" => href } end end end . flatten . compact end
Helper proc for rendering a collection of type specified.
Helper proc for rendering a collection of type specified .
cspec
<not_specific>
is_subcollection
<not_specific>
href
<not_specific>
resource
<not_specific>