Sha256: e0e52ca7fb3a6564a2948b83fbd2ef0cdfd122d1bc37c28592e83de564b1def7

Contents?: true

Size: 1.05 KB

Versions: 21

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module Decidim
  module Verifications
    module IdDocuments
      module Admin
        class PendingAuthorizationsController < Decidim::Admin::ApplicationController
          layout "decidim/admin/users"

          helper_method :has_offline_method?

          def index
            enforce_permission_to :index, :authorization

            @pending_online_authorizations = pending_online_authorizations
          end

          private

          def pending_online_authorizations
            Authorizations
              .new(organization: current_organization, name: "id_documents", granted: false)
              .query
              .where("verification_metadata->'rejected' IS NULL")
              .where("verification_metadata->>'verification_type' = 'online'")
          end

          def has_offline_method?
            available_methods.include?("offline")
          end

          def available_methods
            @available_methods ||= current_organization.id_documents_methods
          end
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
decidim-verifications-0.23.6 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.23.5 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.23.4 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.23.3 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.23.2 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.23.1 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.23.1.rc1 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.23.0 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.22.0 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.21.0 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.20.1 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.20.0 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.19.1 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.18.1 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.19.0 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.17.2 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.18.0 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.17.1 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.16.1 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb
decidim-verifications-0.17.0 app/controllers/decidim/verifications/id_documents/admin/pending_authorizations_controller.rb