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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

spring cloud - How to configure SpringCloud Eureka instance to point to https on non standard port -

javascript - Bootstrap Popover: iOS Safari strange behaviour -