angular-sailsjs-boilerplate icon indicating copy to clipboard operation
angular-sailsjs-boilerplate copied to clipboard

addDataCreate doesn't work with populated data

Open beaverusiv opened this issue 10 years ago • 0 comments

The policies addDataCreate and addDataUpdate are meant to be run on routes that save data to automatically set and update createdUser and updatedUser fields but this doesn't work if you're saving populated data, e.g. saving a role and permissions it has a relationship to in one call like so:

role: {
id: 1
permissions: [{ id:1, writeable: true}, {id:2, writeable: false}],
name: 'Admin'
}

If this was working properly we would see each of the permissions getting these fields added, not just the role. Is this possible in an automatic way?

beaverusiv avatar Nov 24 '15 01:11 beaverusiv