SECURITY: Don't allow moderators to view the admins inbox

This commit is contained in:
Daniel Waterworth 2020-09-07 17:52:51 +01:00
parent 0b8e7d88fe
commit 18d35bf64a

View File

@ -540,7 +540,8 @@ class TopicQuery
SELECT group_id
FROM group_users
WHERE user_id = #{user.id.to_i}
OR #{user.staff?}
OR #{user.admin?}
OR (#{user.staff?} AND group_id <> #{Group::AUTO_GROUPS[:admins]})
)
)
AND group_id IN (SELECT id FROM groups WHERE name ilike ?)