eslint-config-trybe icon indicating copy to clipboard operation
eslint-config-trybe copied to clipboard

Add "createOnly" properties option

Open jakerella opened this issue 9 years ago • 1 comments

I needed to be able to allow REST addition of properties on create, but disallow any update of those properties after creation. This PR implements a second value option for the "ReadOnly" mixin when specifying properties:

"mixins": {
  "ReadOnly": {
    "status": true,  // <-- ALWAYS read only from REST (all operations)
    "role": "createOnly"  // <-- can be set on creation from REST, but not updates from REST
  }
}

jakerella avatar Jan 24 '16 17:01 jakerella

should by extended to whiteListed methods ex. ReadOnly: { email: { writableBy: ['create', 'prototype.patchAttributes'] } }

prochac avatar Feb 07 '18 15:02 prochac