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
{{ message }}
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.
Currently, field can have a specified defaultValue to be used during entity creation.
However, defaultValue can only be a constant. This makes it impossible to use client-side auto-generated defaults.
While server-generated defaults are more secure in general, client-side ones can have some benefits.
Here, the "created_at" field is being preset with a timestamp. However, the timestamp is created incorrectly, new Date() is instantiated during the start of client application, not during the creation of the record, so all the records created during this admin section would have the same date value.
Other possible use cases include auto-generated IDs and passwords. Generating them at client would allow the admin to record or tweak them before saving the data to server.
Currently, field can have a specified defaultValue to be used during entity creation.
However, defaultValue can only be a constant. This makes it impossible to use client-side auto-generated defaults.
While server-generated defaults are more secure in general, client-side ones can have some benefits.
An example can be found in ng-admin sources:
https://github.com/marmelab/ng-admin/blob/bd734ba347add0c2aed6ab995585fb723b04cbd7/examples/blog/config.js#L295
Here, the "created_at" field is being preset with a timestamp. However, the timestamp is created incorrectly,
new Date()
is instantiated during the start of client application, not during the creation of the record, so all the records created during this admin section would have the same date value.Other possible use cases include auto-generated IDs and passwords. Generating them at client would allow the admin to record or tweak them before saving the data to server.
Pull-request to implement the feature: #54
The text was updated successfully, but these errors were encountered: