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

Various fixes to putUser #178

Merged
merged 2 commits into from
Nov 17, 2017

Conversation

ptitjes
Copy link
Collaborator

@ptitjes ptitjes commented Nov 14, 2017

Some fixes to putUser (and its twin signUp):

  • fix(putUser): ensure reserved words are enforced in metadata
    BREAKING CHANGE: In both signUp and putUser, '_id', '_rev', 'name',
    'type', 'roles', 'password', 'password_scheme', 'iterations',
    'derived_key', 'salt' are now all reserved words, and 'metadata' is
    not a reserved word anymore.
  • feat(putUser): take roles in account
    Closes Modifying user roles #114
    Roles can now be modified via putUser by passing ops.roles.

In particular this reimplements the fix of PR #120 from @tlvince, while adding extensive tests.
Also, add the possibility to modify roles through putUser (as can be done with signUp):

db.putUser(username, {roles: ['superhero'], metadata: {email: '[email protected]'}});

BREAKING CHANGE: In both signUp and putUser, '_id', '_rev', 'name',
'type', 'roles', 'password', 'password_scheme', 'iterations',
'derived_key', 'salt' are now all reserved words, and 'metadata' is
not a reserved word anymore.
Closes pouchdb-community#114

Roles can now be modified via putUser by passing ops.roles.
@ptitjes
Copy link
Collaborator Author

ptitjes commented Nov 14, 2017

Someone available to have a second look to this PR @tlvince, @karlwestin, @nolanlawson ?

@ptitjes ptitjes requested a review from tlvince November 15, 2017 10:51
@ptitjes ptitjes merged commit 8e90ef7 into pouchdb-community:master Nov 17, 2017
@ptitjes ptitjes deleted the putUser-various-fixes branch November 17, 2017 17:15
@ptitjes ptitjes restored the putUser-various-fixes branch November 17, 2017 17:19
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.

Modifying user roles
1 participant