Skip to content

Instantly share code, notes, and snippets.

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