reactioncommerce / meteor-security

A Meteor package: Logical MongoDB security

Home Page:https://atmospherejs.com/ongoworks/security

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can rules be set in Meteor.startup funcion?

jakubjafra opened this issue · comments

Hi,

Can rules be put inside Meteor.startup function, or it have to global namespace? I've got some problem with structuring my app, and I wonder if that would be OK.

Meteor.startup(function(){
    Posts.permit(['insert', 'update', 'remove']).apply();
});

Thanks,
Khrone

I think it should work, except that any insert/update/remove prior to server startup would not know about the rules. That said, I can't think of any way for a client to attempt insert/update/remove until the server starts up. So it seems fine.