Multiple user roles, different register page for each (user, owner, admin)

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.

I don’t get it what do you wanna do?

redirect the user to another page where they continue the registration to finish up their profile ?

Sorry if I was unclear. I want a normal “user” registration page, but I want another registration page for “Agents” to register with. And I can’t seem to figure out how to add “Agent” role to a user that registers with the agent registration page.

Thanks!

Here is two registration pages?

Can you check the url and set the role?

Hmm… I guess I could try that out, sounds like it would make sense

or onRendered set a session role to the one you want and use it when the user is created? the clean it?