Hi folks,
I’m attempting to create a multi user application, but I need to separate some functions from normal users (just guests that can save favourites + comment) as opposed to an owner who can create new listings/posts.
I am using the alanning:roles package which is very useful, and I’m using the meteor admin package which automatically added an admin role, which is great.
Now I have a seperate register page to become an “Owner”, and I’m trying to figure out how to differentiate between the two register pages.
Is it possible to have my Accounts.onCreateUser function split up according to template?
This is my code in there now -
Accounts.onCreateUser(function(options, user) { // Use provided profile in options, or create an empty object user.profile = options.profile || {}; //Basic Role Set Up user.roles = ["User"]; // Returns the user object return user; });
So it will automatically add the created account to the “User” role, which is perfect for the normal register page.
But how can I set it up so the ownerRegister template sends to a different onCreateUser?
I might be thinking through this the wrong way, but I’ve been racking my brain and googling my ass off to try and find an answer to this.
Thanks guys.