node.js - How to get the current User inside a 'before save' operation hook? -
loopback.getcurrentcontext() null me. why? need grab current user context. operation hook's ctx not same context , not contain need far can tell.
customer.observe('before save', function checkpermission(ctx, next) { //do have loopback context works? var context = loopback.getcurrentcontext(); console.log("context is: " + context);//null! });
thanks
this isn't postgresql specific, bug. https://github.com/strongloop/loopback/issues/878#issuecomment-128417677
Comments
Post a Comment