Skip to content

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

Merged
rodrigok merged 1 commit intomasterfrom
admin-not-assigned-first-user
Sep 19, 2015
Merged

Fix issue where the first inserted user is not assigned the 'admin' role#836
rodrigok merged 1 commit intomasterfrom
admin-not-assigned-first-user

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.

3 participants

Comments