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

Fix issue where the first inserted user is not assigned the 'admin' role #836

Merged
merged 1 commit into from
Sep 19, 2015

Conversation

rwakida
Copy link
Contributor

@rwakida rwakida commented Sep 19, 2015

Modifies admin role assignment to check if the inserted user is the
first user based on sorted query using "createdAt".

Originally, the admin role assignment was done onCreateUser before
the user record was inserted into the db. It assigned the 'admin' role
to a user if no other user existed in the db. However, with the change
to insertUserDoc, the 'admin' assignment is done AFTER the first user
is inserted and the original query logic (check if any user exists) no
longer applies

role.

Modifies admin role assignment to check if the inserted user is the
first user based on sorted query using "createdAt".

Originally, the admin role assignment was done onCreateUser before
the user record was inserted into the db.  It assigned the 'admin' role
to a user if no other user existed in the db.  However, with the change
to insertUserDoc, the 'admin' assignment is done AFTER the first user
is inserted and the original query logic (check if any user exists) no
longer applies
rodrigok added a commit that referenced this pull request Sep 19, 2015
Fix issue where the first inserted user is not assigned the 'admin' role
@rodrigok rodrigok merged commit 9ea9ee9 into master Sep 19, 2015
@rodrigok rodrigok deleted the admin-not-assigned-first-user branch September 19, 2015 22: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.

None yet

3 participants