FIX: admin not getting updates for topics in secure groups

(only where admin is missing explicit permissions)
This commit is contained in:
Sam 2015-08-25 09:25:39 +10:00
parent 9c882795c3
commit d74d5c47ad
1 changed files with 6 additions and 1 deletions

View File

@ -17,7 +17,12 @@ end
MessageBus.group_ids_lookup do |env|
user = CurrentUser.lookup_from_env(env)
user.groups.select('groups.id').map{|g| g.id} if user
if user && user.admin?
# special rule, admin is allowed access to all groups
Group.pluck(:id)
elsif user
user.groups.pluck('groups.id')
end
end
MessageBus.on_connect do |site_id|