Reputation:
By default, Sails offers access to these routes:
Backbone Conventions
GET : /:controller => findAll() <- THIS ACTION GET : /:controller/read/:id => find(id) POST : /:controller/create => create() POST : /:controller/create/:id => create(id) PUT : /:controller/update/:id => update(id) DELETE: /:controller/destroy/:id => destroy(id)
(taken from then documentation).
In order to set up permissions, config/policies.js can be edited, and permissions can be added like this:
ControllerName: {
'*': false,
update: true,
destroy: true
}
How to set up permissions for the default get action ? (the one that results in an findAll() action).
Thanks.
Upvotes: 1
Views: 613
Reputation: 2881
You could use the find blueprint method like this:
ControllerName: {
'*': false,
update: true,
destroy: true,
find: true
}
Upvotes: 3