[Question] How to add role to newly registered user dynamically

Topics: Administration, Customizing Orchard, Writing modules
Oct 31, 2012 at 3:45 AM

Hi there,

I'm writing a user management module in Orchard for our use, inheriting Ochard.Users module. Now I'm able to create a new user via API. 

But I'm not able to assign role to the user via that current API, so is there any class or function available that would assign Role to the user automatically and can I access that ? My purpose is to let users access to Dashboard as Administrator immediately after they sign up in order to use our other modules which available in /Admin only.

Coordinator
Oct 31, 2012 at 7:51 PM

The user type has the UserRolesPart, which is where that information is defined.