Closed luckypur closed 8 years ago
@luckypur is there a reason we couldn't use excludeAttributes
for the same thing? I thought you were asking for excludeAttributes
to not only be excluded from the resulting output, but the input as well. Otherwise LGTM
@mbroadst Actually exclude and readOnly attributes are entirely different things. Like suppose i rarely want to exclude createdOn, modifiedAt kind of attributes, but they are always read only attributes for sure.
@mbroadst Any update..?
@luckypur hey sorry, crazy weekend :)
I see your point, and this looks good, but could you possibly also add the code path for the update controller and include some basic tests for the functionality?
@mbroadst I am actually new to node+express, so creating a test case may take some time. And i have observed that setting readOnlyAttributes will disable the flexibility of modifying req.body in hooks. Like suppose i want to set 'modifiedBy' in write.before and want to make('modifiedBy') readOnly also..! current PR will delete the modifiedBy, No matter i am setting it manually or its coming from POST requests. So i think best thing is to remove readOnlyAttributes from req.body in Controllers '_control' method in base so that all hooks are always effective. What do you think...? And yeah..Sometimes its better to be Late ... ;)
@mbroadst Please have a look at updated PR.
@luckypur looks good, thanks for the contribution. I'm going to leave it in an unpublished release for now to let you and potentially others check out the feature, you will be able to get the functionality by changing your version for epilogue from ^0.6.5
to dchester/epilogue#master
closes #129
+1 - looks like a nice feature to me :)