mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
SECURITY: Do not leak private group names. (#7008)
This commit is contained in:
committed by
Régis Hanol
parent
b5fbd7385f
commit
70adb94008
@@ -71,6 +71,12 @@ class Site
|
||||
end
|
||||
end
|
||||
|
||||
def groups
|
||||
groups = Group.visible_groups(@guardian.user)
|
||||
groups = groups.where("automatic IS FALSE OR groups.id = #{Group::AUTO_GROUPS[:moderators]}") if !@guardian.is_staff?
|
||||
groups
|
||||
end
|
||||
|
||||
def suppressed_from_latest_category_ids
|
||||
categories.select { |c| c.suppress_from_latest == true }.map(&:id)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user