javascript - Meteor how to debug allow/deny -
i'm working on meteor project , started setting 1 of first more complex allow/deny rules. find quite hard see allow triggered , not , variables inside these functions contain. example:
list.allow({ update: function(userid, docs, fields, modifier) { if(!docs.user){ console.log("list without owner => updateable everyone"); return true; } else if(userid === docs.user){ console.log("user owner of list => updateable!"); return true; } else { console.log("no access, not owner"); return false; } } });
the console.log statements not work (nothing logged in console). i'd know docs, fields , modifier contains in moment allow-rule checked adjust code. how can debug in these methods? if not, can correct code? have collection meteor.users can have own record, should updat
use meteor debug
instead of meteor run
start meteor application. add node inspector package running meteor app can debug it.
also can use meteor shell
in cli.
for more info josh owen's blog
Comments
Post a Comment