app/controllers/ops_controller/ops_rbac.rb
# Get information for an access control node
Get information for an access control node
Get information for an access control node
def rbac_get_info
    node, id = x_node.split("-")
    case node
    when "xx"
      case id
      when "u"
        @right_cell_text = _("Access Control %{model}") % {:model => ui_lookup(:models => "User")}
        rbac_users_list
      when "g"
        @right_cell_text = _("Access Control %{model}") % {:model => ui_lookup(:models => "MiqGroup")}
        rbac_groups_list
      when "ur"
        @right_cell_text = _("Access Control %{model}") % {:model => ui_lookup(:models => "MiqUserRole")}
        rbac_roles_list
      when "tn"
        @right_cell_text = _("Access Control %{model}") % {:model => ui_lookup(:models => "Tenant")}
        rbac_tenants_list
      end
    when "u"
      @right_cell_text = _("%{model} \"%{name}\"") % {:model => ui_lookup(:model => "User"), :name => User.find_by_id(from_cid(id)).name}
      rbac_user_get_details(id)
    when "g"
      @right_cell_text = _("%{model} \"%{name}\"") % {:model => ui_lookup(:model => "MiqGroup"), :name => MiqGroup.find_by_id(from_cid(id)).description}
      rbac_group_get_details(id)
    when "ur"
      @right_cell_text = _("%{model} \"%{name}\"") % {:model => ui_lookup(:model => "MiqUserRole"), :name => MiqUserRole.find_by_id(from_cid(id)).name}
      rbac_role_get_details(id)
    when "tn"
      rbac_tenant_get_details(id)
      @right_cell_text = _("%{model} \"%{name}\"") % {:model => tenant_type_title_string(@tenant.divisible),
                                                      :name  => @tenant.name}
    else  
      @right_cell_text = _("Access Control %{model} \"%{name}\"") %
                         {:name  => "#{MiqRegion.my_region.description} [#{MiqRegion.my_region.region}]",
                          :model => ui_lookup(:model => "MiqRegion")}
      @users_count   = User.in_my_region.count
      @groups_count  = MiqGroup.non_tenant_groups.count
      @roles_count   = MiqUserRole.count
      @tenants_count = Tenant.roots.count
    end
  end
def rbac_get_info node , id = x_node . split ( "-" ) case node when "xx" case id when "u" @right_cell_text = _ ( "Access Control %{model}" ) % { :model => ui_lookup ( :models => "User" ) } rbac_users_list when "g" @right_cell_text = _ ( "Access Control %{model}" ) % { :model => ui_lookup ( :models => "MiqGroup" ) } rbac_groups_list when "ur" @right_cell_text = _ ( "Access Control %{model}" ) % { :model => ui_lookup ( :models => "MiqUserRole" ) } rbac_roles_list when "tn" @right_cell_text = _ ( "Access Control %{model}" ) % { :model => ui_lookup ( :models => "Tenant" ) } rbac_tenants_list end when "u" @right_cell_text = _ ( "%{model} \"%{name}\"" ) % { :model => ui_lookup ( :model => "User" ) , :name => User . find_by_id ( from_cid ( id ) ) . name } rbac_user_get_details ( id ) when "g" @right_cell_text = _ ( "%{model} \"%{name}\"" ) % { :model => ui_lookup ( :model => "MiqGroup" ) , :name => MiqGroup . find_by_id ( from_cid ( id ) ) . description } rbac_group_get_details ( id ) when "ur" @right_cell_text = _ ( "%{model} \"%{name}\"" ) % { :model => ui_lookup ( :model => "MiqUserRole" ) , :name => MiqUserRole . find_by_id ( from_cid ( id ) ) . name } rbac_role_get_details ( id ) when "tn" rbac_tenant_get_details ( id ) @right_cell_text = _ ( "%{model} \"%{name}\"" ) % { :model => tenant_type_title_string ( @tenant . divisible ) , :name => @tenant . name } else @right_cell_text = _ ( "Access Control %{model} \"%{name}\"" ) % { :name => "#{MiqRegion.my_region.description} [#{MiqRegion.my_region.region}]" , :model => ui_lookup ( :model => "MiqRegion" ) } @users_count = User . in_my_region . count @groups_count = MiqGroup . non_tenant_groups . count @roles_count = MiqUserRole . count @tenants_count = Tenant . roots . count end end
Get information for an access control node
Get information for an access control node
# Root node