Sha256: 4c24622f0789d9e78aee1dc6c8fb17a923f80d394b9fc91448037656cd6a0da5

Contents?: true

Size: 902 Bytes

Versions: 68

Compression:

Stored size: 902 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Admin
    # Controller that lists users in order to perform impersonation actions on
    # them
    #
    class ImpersonatableUsersController < Decidim::Admin::ApplicationController
      layout "decidim/admin/users"

      helper_method :new_managed_user

      def index
        enforce_permission_to :index, :impersonatable_user

        @query = params[:q]
        @state = params[:state]

        @users = Decidim::Admin::UserFilter.for(collection, @query, @state)
                                           .page(params[:page])
                                           .per(15)
      end

      private

      def collection
        @collection ||= current_organization.users.where(admin: false, roles: [])
      end

      def new_managed_user
        Decidim::User.new(managed: true, admin: false, roles: [])
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
decidim-admin-0.26.10 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.9 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.27.5 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.8 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.27.4 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.27.3 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.7 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.5 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.27.2 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.27.1 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.4 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.27.0 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.3 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.27.0.rc2 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.27.0.rc1 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.2 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.1 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.0 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.0.rc2 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.26.0.rc1 app/controllers/decidim/admin/impersonatable_users_controller.rb