Class: Decidim::Verifications::IdDocuments::Admin::RejectionsController

Inherits:
Admin::ApplicationController show all
Defined in:
decidim-verifications/app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb

Overview

Handles rejections for verification by identity document upload.

Instance Method Summary collapse

Methods inherited from Admin::ApplicationController

#permission_class_chain, #permission_scope, #user_has_no_permission_path, #user_not_authorized_path

Methods included from HttpCachingDisabler

#disable_http_caching

Methods included from NeedsSnippets

#snippets

Methods included from RegistersPermissions

register_permissions

Methods included from NeedsOrganization

enhance_controller, extended, included

Instance Method Details

#createObject


15
16
17
18
19
20
21
22
23
24
25
26
# File 'decidim-verifications/app/controllers/decidim/verifications/id_documents/admin/rejections_controller.rb', line 15

def create
  enforce_permission_to :update, :authorization, authorization: @pending_authorization

  @form = InformationRejectionForm.from_model(@pending_authorization)

  PerformAuthorizationStep.call(@pending_authorization, @form) do
    on(:ok) do
      flash[:notice] = t("rejections.create.success", scope: "decidim.verifications.id_documents.admin")
      redirect_to root_path
    end
  end
end