Add missing authorization to ReactService
This commit is contained in:
parent
fa0a5a70c7
commit
b0b593d525
2 changed files with 6 additions and 0 deletions
|
@ -28,6 +28,10 @@ class StatusPolicy < ApplicationPolicy
|
||||||
show? && !blocking_author?
|
show? && !blocking_author?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def react?
|
||||||
|
show? && !blocking_author?
|
||||||
|
end
|
||||||
|
|
||||||
def destroy?
|
def destroy?
|
||||||
owned?
|
owned?
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,6 +5,8 @@ class ReactService < BaseService
|
||||||
include Payloadable
|
include Payloadable
|
||||||
|
|
||||||
def call(account, status, emoji)
|
def call(account, status, emoji)
|
||||||
|
authorize_with account, status, :react?
|
||||||
|
|
||||||
name, domain = emoji.split('@')
|
name, domain = emoji.split('@')
|
||||||
custom_emoji = CustomEmoji.find_by(shortcode: name, domain: domain)
|
custom_emoji = CustomEmoji.find_by(shortcode: name, domain: domain)
|
||||||
reaction = StatusReaction.find_by(account: account, status: status, name: name, custom_emoji: custom_emoji)
|
reaction = StatusReaction.find_by(account: account, status: status, name: name, custom_emoji: custom_emoji)
|
||||||
|
|
Loading…
Reference in a new issue