Add missing authorization to ReactService

This commit is contained in:
Jeremy Kescher 2023-05-07 22:05:44 +02:00
parent 8eff35ad53
commit fdee1b200e
No known key found for this signature in database
GPG key ID: 80A419A7A613DFA4
2 changed files with 6 additions and 0 deletions

View file

@ -28,6 +28,10 @@ class StatusPolicy < ApplicationPolicy
show? && !blocking_author?
end
def react?
show? && !blocking_author?
end
def destroy?
owned?
end

View file

@ -5,6 +5,8 @@ class ReactService < BaseService
include Payloadable
def call(account, status, emoji)
authorize_with account, status, :react?
name, domain = emoji.split('@')
custom_emoji = CustomEmoji.find_by(shortcode: name, domain: domain)
reaction = StatusReaction.find_by(account: account, status: status, name: name, custom_emoji: custom_emoji)