Created
August 30, 2015 06:27
meteor add role after createUser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// insert user and retrieve the id | |
id = Accounts.createUser({ | |
email: user.email, | |
password: "apple1", | |
profile: { name: user.name } | |
}); | |
// now we can verify that the user was inserted and add permissions | |
if (user.roles.length > 0) { | |
Roles.addUsersToRoles(id, user.roles); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment