mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FIX: restrict other user's notification routes (#14442)
It was possible to see notifications of other users using routes: - notifications/responses - notifications/likes-received - notifications/mentions - notifications/edits We weren't showing anything private (like notifications about private messages), only things that're publicly available in other places. But anyway, it feels strange that it's possible to look at notifications of someone else. Additionally, there is a risk that we can unintentionally leak something on these pages in the future. This commit restricts these routes.
This commit is contained in:
@@ -55,6 +55,16 @@ class UserAction < ActiveRecord::Base
|
||||
assigned: 16)
|
||||
end
|
||||
|
||||
def self.private_types
|
||||
@private_types ||= [
|
||||
WAS_LIKED,
|
||||
RESPONSE,
|
||||
MENTION,
|
||||
QUOTE,
|
||||
EDIT
|
||||
]
|
||||
end
|
||||
|
||||
def self.last_action_in_topic(user_id, topic_id)
|
||||
UserAction.where(user_id: user_id,
|
||||
target_topic_id: topic_id,
|
||||
|
||||
Reference in New Issue
Block a user