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.25.2 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.25.1 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.25.0 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.25.0.rc4 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.25.0.rc3 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.25.0.rc2 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.25.0.rc1 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.24.3 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.23.6 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.24.2 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.23.5 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.24.1 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.24.0 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.24.0.rc2 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.23.4 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.24.0.rc1 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.23.3 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.23.2 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.23.1 app/controllers/decidim/admin/impersonatable_users_controller.rb
decidim-admin-0.23.1.rc1 app/controllers/decidim/admin/impersonatable_users_controller.rb