module.exports={'new':function(req,res){res.locals.flash=_.clone(req.session.flash);res.view();req.session.flash={};},create:function(req,res,next){User.create(req.params.all(),functionuserCreated(err,user){//if(err) return next(err);if(err){console.log(err);req.session.flash={err:err}//if error redirect back to sign-up pagereturnres.redirect('/user/new');}res.json(user);req.session.flash={};});}};
module.exports.policies={/*************************************************************************** * * * Default policy for all controllers and actions (`true` allows public * * access) * * * ***************************************************************************///'*': true,'*':'flash',user:{'new':"flash",'create':"flash"}/*************************************************************************** * * * Here's an example of mapping some policies to run before a controller * * and its actions * * * ***************************************************************************/巴拉巴拉