sails-permissions
sails-permissions copied to clipboard
Owner / createdBy not working on all models
For some reason only some of my models are being populated with the owner and createdBy attributes and I've not set autoCreatedBy to false anywhere. Is there any other reason why this would be happening?
Depending on which version of sails-permissions you are using, owner is not always set on the models. createdBy should be more consistent. Do you have any more information about which models get owner/createdBy and which don't? Are the ones that aren't getting owner/createdBy being created through the rest api?
I'm using v1.4.4
I have a backbone app so yes it is using a rest api but the creation of models on ones that do and don't have the owner/createdBy are handled by a Sails Controller anyway i.e Model.create
I've been using sails-permissions on this app for some time so could there be something left from a previous version causing it not to work.
Also are there any guidelines as to when and why a owner get added as it's a bit confusing when it's not consistent.
On previous versions, owner was only created if it was set manually, but that was changed in a recent pull request: https://github.com/tjwebb/sails-permissions/pull/118
Looks like the first version it was included was 1.4.0
i have a question, why do we use owner instead of createdBy aren't they synonymous.
Theoretically, the owner of an object does not necessarily have to be the entity that created it.
@dottodot is this still an open issue?