sails-permissions
sails-permissions copied to clipboard
User permission have the relation set to "role"
When I create a Permission linked to a user, the "relation" attribute is set to "role", instead of "user". Example:
Permission: {
"model": "560a8c5c82b8e74f11e46938",
"user": "560a8ebb80d3f401134a1488",
"action": "create",
"relation": "role",
"createdAt": "2015-09-29T13:14:35.929Z",
"updatedAt": "2015-09-29T13:14:35.929Z",
"id": "560a8ebb80d3f401134a14ca"
}
How are you creating the permission?
Thanks to PermissionService.grant().
PermissionService.grant([
{ user: user.id, model: "post", action: "create" },
{ user: user.id, model: "post", action: "read" },
...