Code review changes
* RowPermissionsWrite will now check updating items before and after update, to prevent changing entity from not permitted to permitted state
* Added test for the above case
* Minor code corrections