Class: Decidim::Verifications::RevokeAllAuthorizationsJob
- Inherits:
-
ApplicationJob
- Object
- ApplicationJob
- Decidim::Verifications::RevokeAllAuthorizationsJob
- Defined in:
- app/jobs/decidim/verifications/revoke_all_authorizations_job.rb
Instance Method Summary collapse
-
#perform(organization, current_user) ⇒ Object
Revokes every granted authorization for the given organization.
Instance Method Details
#perform(organization, current_user) ⇒ Object
Revokes every granted authorization for the given organization.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/jobs/decidim/verifications/revoke_all_authorizations_job.rb', line 12 def perform(organization, current_user) auths = Decidim::Verifications::Authorizations.new( organization:, granted: true ).query.includes(transfers: :records) auths.find_each do |auth| Decidim.traceability.perform_action!( :destroy, auth, current_user ) do auth.destroy end end end |