5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 22:06:21 +00:00

Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl

This commit is contained in:
Sutty 2024-03-22 15:00:11 +00:00
commit 4f58b138bc
4 changed files with 13 additions and 7 deletions

View file

@ -29,16 +29,18 @@ class ActivityPubsController < ApplicationController
end
def action_on_several
redirect_to_moderation_queue!
activity_pubs = site.activity_pubs.where(id: params[:activity_pub])
return if activity_pubs.count.zero?
authorize activity_pubs
action = params[:activity_pub_action].to_sym
method = :"#{action}_all!"
may = :"may_#{action}?"
redirect_to_moderation_queue!
return unless ActivityPub.events.include? action
# Crear una sola remote flag por autore

View file

@ -48,16 +48,18 @@ class ActorModerationsController < ApplicationController
end
def action_on_several
redirect_to_moderation_queue!
actor_moderations = site.actor_moderations.where(id: params[:actor_moderation])
return if actor_moderations.count.zero?
authorize actor_moderations
action = params[:actor_moderation_action].to_sym
method = :"#{action}_all!"
may = :"may_#{action}?"
redirect_to_moderation_queue!
return unless ActorModeration.events.include? action
ActorModeration.transaction do

View file

@ -22,15 +22,17 @@ class InstanceModerationsController < ApplicationController
end
def action_on_several
redirect_to_moderation_queue!
instance_moderations = site.instance_moderations.where(id: params[:instance_moderation])
return if instance_moderations.count.zero?
authorize instance_moderations
action = params[:instance_moderation_action].to_sym
method = :"#{action}_all!"
redirect_to_moderation_queue!
return unless InstanceModeration.events.include? action
InstanceModeration.transaction do

View file

@ -11,6 +11,6 @@ InstanceModerationPolicy = Struct.new(:usuarie, :instance_moderation) do
# En este paso tenemos varias instancias por moderar pero todas son
# del mismo sitio.
def action_on_several?
instance_moderation.first.site.usuarie? usuarie
instance_moderation.first.presence && instance_moderation.first.site.usuarie? usuarie
end
end