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

usernameMatchesField should allow creation of new documents #8

Open
natevw opened this issue Nov 13, 2012 · 1 comment
Open

usernameMatchesField should allow creation of new documents #8

natevw opened this issue Nov 13, 2012 · 1 comment

Comments

@natevw
Copy link

natevw commented Nov 13, 2012

When oldDoc is null, the usernameMatchesField always rejects the document — this makes it a hassle to use, as it requires breaking out the create action to use a different validator.

@natevw
Copy link
Author

natevw commented Nov 13, 2012

To clarify, right now to use permissions.usernameMatchesField you must explicitly combine broken-out permissions with fields.creator() on the field itself for the initial validation:

permissions: {
    update: permissions.usernameMatchesField('user'),
    remove: permissions.usernameMatchesField('user')
},
fields: {
    user: fields.creator(),
}

Would make a sense to me if (e.g.) the following worked just as well:

permissions: permissions.usernameMatchesField('user'),
allow_extra_fields: true

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

No branches or pull requests

1 participant