Skip to content

Add "createOnly" properties option - #5

Open
jakerella wants to merge 3 commits into
fullcube:masterfrom
jakerella:create-only-props
Open

jakerella wants to merge 3 commits into
fullcube:masterfrom
jakerella:create-only-props

Conversation

@jakerella

Copy link
Copy Markdown

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
  }
}

@prochac

prochac commented Feb 7, 2018

Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants