app/controllers/ops_controller/ops_rbac.rb
# Create the view and associated vars for the rbac list
Create the view and associated vars for the rbac list
Create the view and associated vars for the rbac list
def rbac_build_list(rec_type)
    @lastaction = "rbac_#{rec_type}s_list"
    @force_no_grid_xml = true
    @gtl_type = "list"
    @ajax_paging_buttons = true
    if params[:ppsetting]                                             
      @items_per_page = params[:ppsetting].to_i                       
      @settings[:perpage][@gtl_type.to_sym] = @items_per_page         
    end
    @sortcol = session["rbac_#{rec_type}_sortcol"].nil? ? 0 : @sb["rbac_#{rec_type}_sortcol"].to_i
    @sortdir = session["rbac_#{rec_type}_sortdir"].nil? ? "ASC" : @sb["rbac_#{rec_type}_sortdir"]
    @view, @pages = case rec_type
                    when "user"
                      get_view(User, :named_scope => :in_my_region)
                    when "group"
                      get_view(MiqGroup, :named_scope => :non_tenant_groups)
                    when "role"
                      get_view(MiqUserRole)
                    when "tenant"
                      get_view(Tenant)
                    end
    @current_page = @pages[:current] unless @pages.nil? 
    @sb["rbac_#{rec_type}_sortcol"] = @sortcol
    @sb["rbac_#{rec_type}_sortdir"] = @sortdir
  end
def rbac_build_list ( rec_type ) @lastaction = "rbac_#{rec_type}s_list" @force_no_grid_xml = true @gtl_type = "list" @ajax_paging_buttons = true if params [ :ppsetting ] @items_per_page = params [ :ppsetting ] . to_i @settings [ :perpage ] [ @gtl_type . to_sym ] = @items_per_page end @sortcol = session [ "rbac_#{rec_type}_sortcol" ] . nil? ? 0 : @sb [ "rbac_#{rec_type}_sortcol" ] . to_i @sortdir = session [ "rbac_#{rec_type}_sortdir" ] . nil? ? "ASC" : @sb [ "rbac_#{rec_type}_sortdir" ] @view , @pages = case rec_type when "user" get_view ( User , :named_scope => :in_my_region ) when "group" get_view ( MiqGroup , :named_scope => :non_tenant_groups ) when "role" get_view ( MiqUserRole ) when "tenant" get_view ( Tenant ) end @current_page = @pages [ :current ] unless @pages . nil? @sb [ "rbac_#{rec_type}_sortcol" ] = @sortcol @sb [ "rbac_#{rec_type}_sortdir" ] = @sortdir end
Create the view and associated vars for the rbac list
Create the view and associated vars for the rbac list
# User selected new per page value # Set the new per page value # Set the per page setting for this gtl type # Get the records (into a view) and the paginator # save the current page number
rec_type
<not_specific>