Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "createOnly" properties option #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jakerella
Copy link

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
Copy link

prochac commented Feb 7, 2018

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