Sha256: 196bbb9241722f0185b8ed2da3e3989108ed93a1b70961ad208a3e740ed8b7ba

Contents?: true

Size: 1.55 KB

Versions: 53

Compression:

Stored size: 1.55 KB

Contents

# frozen_string_literal: true

module Decidim
  module Verifications
    module Admin
      class VerificationsController < Decidim::Admin::ApplicationController
        def destroy_before_date
          enforce_permission_to :destroy, :authorization
          return unless params.has_key?(:revocations_before_date)

          form = RevocationsBeforeDateForm.from_params(params[:revocations_before_date])
          RevokeByConditionAuthorizations.call(current_organization, current_user, form) do
            on(:ok) do
              flash[:notice] = t("authorization_revocation.destroy_ok", scope: "decidim.admin.menu")
              redirect_to decidim_admin.authorization_workflows_url
            end
            on(:invalid) do
              flash.now[:alert] = t("authorization_revocation.destroy_nok", scope: "decidim.admin.menu")
              redirect_to decidim_admin.authorization_workflows_url
            end
          end
        end

        def destroy_all
          enforce_permission_to :destroy, :authorization
          RevokeAllAuthorizations.call(current_organization, current_user) do
            on(:ok) do
              flash[:notice] = t("authorization_revocation.destroy_ok", scope: "decidim.admin.menu")
              redirect_to decidim_admin.authorization_workflows_url
            end
            on(:invalid) do
              flash.now[:alert] = t("authorization_revocation.destroy_nok", scope: "decidim.admin.menu")
              redirect_to decidim_admin.authorization_workflows_url
            end
          end
        end
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
decidim-verifications-0.28.4 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.27.9 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.28.3 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.27.8 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.28.2 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.27.7 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.28.1 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.27.6 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.26.10 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.26.9 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.28.0 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.27.5 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.28.0.rc5 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.28.0.rc4 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.26.8 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.27.4 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.27.3 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.26.7 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.26.5 app/controllers/decidim/verifications/admin/verifications_controller.rb
decidim-verifications-0.27.2 app/controllers/decidim/verifications/admin/verifications_controller.rb