Meteor - Deny read? -
how deny reads of collection in meteor?
there no allow/deny method , can't in collection publish filter since runs once. i'm shocked, thought make sense template render blank if denied read.
meteor looks works fine in website single type of user how segregate data more reading?
you can call .stop() in publish callback function after checking user role
there example here. https://github.com/alanning/meteor-roles#usage-examples
meteor.publish('secrets', function (group) { if (roles.userisinrole(this.userid, ['view-secrets','admin'], group)) { return meteor.secrets.find({group: group}); } else { // user not authorized. not publish secrets this.stop(); return; } });
i found answer after quite bit of googling. helps other people. still find odd can't define read property on allow or deny , achieve same behavior.
Comments
Post a Comment