You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have following code for chat application with channels:
stream.permissions.write(function(eventName,message,channelName){varcurrentUser=Meteor.users.findOne({_id : this.userId});return_.contains(currentUser.channelsJoined,channelName)// if user joined chat - allow him to send chat stream message},false);}stream.permissions.read(function(eventName,message,channelName){varcurrentUser=Meteor.users.findOne({_id : this.userId});return_.contains(currentUser.channelsJoined,channelName)// if user joined chat - allow him to receive chat stream message},false);}
When I pass channel name in emit - write permissions sees it, however in read permissions code channelName argument is undefined. I didn't find much about this in documentation and it seems it should work like that. What I am doing wrong? Or is it a bug? Because permissions without additional parameters is pretty much useless in real world scenarios...
The text was updated successfully, but these errors were encountered:
Hi,
I have following code for chat application with channels:
When I pass channel name in emit - write permissions sees it, however in read permissions code channelName argument is undefined. I didn't find much about this in documentation and it seems it should work like that. What I am doing wrong? Or is it a bug? Because permissions without additional parameters is pretty much useless in real world scenarios...
The text was updated successfully, but these errors were encountered: