So I'm slowly concurring the ultimate-seed monster and have come across an issue that I can't seem to get past. If you're familiar with Pilwon's https://github.com/pilwon/ultimate-seed, it uses his https://github.com/pilwon/node-ultimate for automatically creating restful controllers from Mongoose schemas. I have added my own Model called Company and pretty much copied the User model to create the CRUD controller for the Company model. Here's the restify part -
// Restify
schema.restify = {
'list': {
'admin': '*',
'user': '*'
},
'get': {
'admin': '*',
'user': '*'
},
'post': {
'admin': '*'
},
'put': {
'admin': '*',
'user': '*'
},
'delete': {
'admin': '*'
}
};
In addition, I also added the following to routes.js -
restify.model('/api/company', 'Company');
Now, the GET api/company works fine, POST api/company gives the correct error when logged in as 'user' -
{
"error": {
"code": 403,
"message": "Must be admin."
},
"result": null,
"method": "POST",
"url": "/api/company",
"query": {}
}
but for some reason, PUT api/company gives the following error -
Cannot PUT /api/company
Can anyone who has worked with Ultimate-Seed help?
Thanks,
_K