Monday, August 3, 2015

Using Method Call In Meteor

In my last post I showed how to use publish/subscribe in meteor and how to allow access for specific  data in our database. But still every user have Create/Update/Delete privileges. Now we should remove those client side privilege and do those operations only in server side. To do that we can use meteor methods. The all the database functionalities can be execute only in server side.
First we will remove insecure package from meteor.
Run the application and try to create a student. You will get Access Denied Error.
Methods allow us to call database create/update/delete operation without executing that code in client side. First we will implement method for create student. Add studentMethods.js file into server folder and content should be like below.
Then modify studentCreate.js file like below. Then student create should work fine.
Download source code from github.

No comments:

Post a Comment