Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional parameters is null in read permissions #32

Open
ignl opened this issue Feb 20, 2015 · 4 comments
Open

Additional parameters is null in read permissions #32

ignl opened this issue Feb 20, 2015 · 4 comments

Comments

@ignl
Copy link

ignl commented Feb 20, 2015

Hi,

I have following code for chat application with channels:

stream.permissions.write(function(eventName, message, channelName) {
    var currentUser = 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) {
    var currentUser = 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...

@ignl
Copy link
Author

ignl commented Feb 20, 2015

Also channel argument is undefined on receiving message in client:

stream.on('chat', function(message, channel) {

@ignl
Copy link
Author

ignl commented Feb 22, 2015

Is this project dead?

@matteodem
Copy link
Contributor

Yep.

@ignl
Copy link
Author

ignl commented Feb 23, 2015

Ok I see, thanks, I guess I need an alternative...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants