Method: MessageBus::Client#allowed?
- Defined in:
- lib/message_bus/client.rb
#allowed?(msg) ⇒ Boolean
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/message_bus/client.rb', line 56 def allowed?(msg) allowed = !msg.user_ids || msg.user_ids.include?(self.user_id) allowed &&= !msg.client_ids || msg.client_ids.include?(self.client_id) allowed && ( msg.group_ids.nil? || msg.group_ids.length == 0 || ( msg.group_ids - self.group_ids ).length < msg.group_ids.length ) end |