fullcube / loopback-ds-readonly-mixin

A mixin to enable readonly properties for loopback Models
MIT License
51 stars 19 forks source link

feat: allow writing properties on creation selectively #35

Open DaniGuardiola opened 6 years ago

DaniGuardiola commented 6 years ago

Inspired by #5 and based on the latest version in master, I implemented an option __allowCreation that will receive an array of property keys that will be allowed to be set at creation.

For explanation and example check the updated README.

Added a specific test.

DaniGuardiola commented 6 years ago

Might be worth it adding another test to check if update of whitelisted properties still fails.

DaniGuardiola commented 6 years ago

Not sure about the instance id fix I introduced...