mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 19:16:23 +00:00
36 lines
701 B
Ruby
36 lines
701 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# Actualiza la relación entre un sitio y una instancia
|
||
|
class InstanceModerationsController < ApplicationController
|
||
|
before_action :authorize_policy
|
||
|
|
||
|
def pause
|
||
|
instance_moderation.pause!
|
||
|
|
||
|
redirect_to site_moderation_queue_path
|
||
|
end
|
||
|
|
||
|
def allow
|
||
|
instance_moderation.allow!
|
||
|
|
||
|
redirect_to site_moderation_queue_path
|
||
|
end
|
||
|
|
||
|
def block
|
||
|
instance_moderation.block!
|
||
|
|
||
|
redirect_to site_moderation_queue_path
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
# @return [InstanceModeration]
|
||
|
def instance_moderation
|
||
|
@instance_moderation ||= site.instance_moderations.find(params[:instance_moderation_id])
|
||
|
end
|
||
|
|
||
|
def authorize_policy
|
||
|
authorize instance_moderation
|
||
|
end
|
||
|
end
|