Created
August 30, 2015 06:27
-
-
Save devinceble/3c95afc14bd9ab44cc18 to your computer and use it in GitHub Desktop.
meteor add role after createUser
This file contains 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