mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Implement SiteSetting to Allow Anonymous Likes (#22131)
Allow anonymous users (logged-in, but set to anonymous posting) to like posts --------- Co-authored-by: Emmett Ling <eling@zendesk.com> Co-authored-by: Nat <natalie.tay@discourse.org>
This commit is contained in:
@@ -315,8 +315,14 @@ class PostSerializer < BasicPostSerializer
|
||||
summary.delete(:can_act)
|
||||
end
|
||||
|
||||
if actions.present? && SiteSetting.allow_anonymous_likes && sym == :like &&
|
||||
!scope.can_delete_post_action?(actions[id])
|
||||
summary.delete(:can_act)
|
||||
end
|
||||
|
||||
if actions.present? && actions.has_key?(id)
|
||||
summary[:acted] = true
|
||||
|
||||
summary[:can_undo] = true if scope.can_delete?(actions[id])
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user