Skip to content

Additional parameters is null in read permissions #32

@ignl

Description

@ignl

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions