You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want only a subset of properties from a model you may select the properties in question with select: ['name', 'favoriteColor']
While we can easily use this in our blueprints it is difficult to protect against injection or implement whitelisting of parameters. Someone could always alter the query to select all columns.
Therefore I suggest adding means to "decorate" models. You got a model but define a "sub-model" which only contains a subset of its properties.
They should also be able to be bound to policies (a registered user gets different properties than an authenticated one).
The text was updated successfully, but these errors were encountered:
The concept of beforeFind and afterFind have been discussed a few places in Waterline. Right now it looks like some solution is scheduled for 0.11 of Waterline. You can start here: https://github.com/balderdashy/waterline/issues/923 and follow the rabbit hole for more discussions.
If you want only a subset of properties from a model you may select the properties in question with
select: ['name', 'favoriteColor']
While we can easily use this in our blueprints it is difficult to protect against injection or implement whitelisting of parameters. Someone could always alter the query to select all columns.
Therefore I suggest adding means to "decorate" models. You got a model but define a "sub-model" which only contains a subset of its properties.
They should also be able to be bound to policies (a registered user gets different properties than an authenticated one).
The text was updated successfully, but these errors were encountered: