How to hook before execute the method [Server]


#1

How to hook before execute the method
Ex.

Meteor.methods({
    'foo':()=> // hook before call this method (Adding the Middleware for checking user permission)
    {
       //process
    }
});

Thanks


#2

which middleware? in the method you directly have access to Meteor.user() so you can begin with your checks


#3

You can try using validated-methods, there are mixins for what you want to do and you can also create your own.


#4

meteor/validated-method

Thanks. :grinning: