@@ -42,9 +42,15 @@ class Paginable::PlansController < ApplicationController
     unless current_user.present? && current_user.can_org_admin?
       raise Pundit::NotAuthorizedError
     end
+    #check if current user if super_admin
+    @super_admin = current_user.can_super_admin?
+    plans = @super_admin ? Plan.all : current_user.org.plans
+    plans = plans.joins(:template, roles: [user: :org]).where(Role.creator_condition)
+
     paginable_renderise(
       partial: "org_admin",
-      scope: current_user.org.plans,
+      scope: plans,
+      view_all: !current_user.can_super_admin?,
       query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }
     )
   end
# frozen_string_literal: true

class Paginable::PlansController < ApplicationController

  include Paginable

  # /paginable/plans/privately_visible/:page
  def privately_visible
    unless Paginable::PlanPolicy.new(current_user).privately_visible?
      raise Pundit::NotAuthorizedError
    end
    paginable_renderise(
      partial: "privately_visible",
      scope: Plan.active(current_user),
      query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }
    )
  end

  # GET /paginable/plans/organisationally_or_publicly_visible/:page
  def organisationally_or_publicly_visible
    unless Paginable::PlanPolicy.new(current_user).organisationally_or_publicly_visible?
      raise Pundit::NotAuthorizedError
    end
    paginable_renderise(
      partial: "organisationally_or_publicly_visible",
      scope: Plan.organisationally_or_publicly_visible(current_user),
      query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }
    )
  end

  # GET /paginable/plans/publicly_visible/:page
  def publicly_visible
    paginable_renderise(
      partial: "publicly_visible",
      scope: Plan.publicly_visible.includes(:template),
      query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }
    )
  end

  # GET /paginable/plans/org_admin/:page
  def org_admin
    unless current_user.present? && current_user.can_org_admin?
      raise Pundit::NotAuthorizedError
    end
    paginable_renderise(
      partial: "org_admin",
      scope: current_user.org.plans,
      query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }
    )
  end

  # GET /paginable/plans/org_admin/:page
  def org_admin_other_user
    @user = User.find(params[:id])
    authorize @user
    unless current_user.present? && current_user.can_org_admin? && @user.present?
      raise Pundit::NotAuthorizedError
    end
    paginable_renderise(
      partial: "org_admin_other_user",
      scope: Plan.active(@user),
      query_params: { sort_field: 'plans.updated_at', sort_direction: :desc }
    )
  end

end

you'd likely want to do this joins+where in the plans_controller as well . Also consider using `includes` if the roles are displayed in the table layout. Includes forces eager loading whereas joins implements an `INNER JOIN` on the relation and uses lazy loading