- Try creating roles and giving them permissions.
- Assigning Roles to Users
Ref.
PermissionService.createRole({ name: 'carsCategoryAdmin', permissions: [ { action: 'update', model: 'review', criteria: [{ where: { category: 'cars'}}]}, { action: 'delete', model: 'review', criteria: [{ where: { category: 'cars'}}]} ], users: ['venise'] })
You can check the role and the corresponding permissions and users,
Role.find({name:'carsCategoryAdmin'}) .populate('users') .populate('permissions') .exec(console.log)
Read more @ sails-permissions-by-example
See how to get user rights with the code in the comment given by skrichten on May 10, 2014 .
Somnath muluk
source share