diff --git a/config/initializers/04-message_bus.rb b/config/initializers/04-message_bus.rb index b8d67a09649..00bf806d410 100644 --- a/config/initializers/04-message_bus.rb +++ b/config/initializers/04-message_bus.rb @@ -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|