Roles in AspNet Application

Hi,
I am using AspDotNet template of servicestack downloaded from official website.
I found various tables for user management. AspNetUser, AspNetRoles, AspNetUserRoles etc.

Now if I use the Register API which is a built in api it will add that new user inside AspNetUser.

What’s the right way to add new roles and assign those role/roles to existing user?

When using Identity Auth you would need to use .NET’s Identity Auth classes to modify the Identity Auth User tables.

The AddSeedUsers() method in Configure.Db.Migrations.cs shows examples of creating roles

and assigning them to Users:

If you include Assign Roles APIs in your Auth Configuration:

services.AddPlugin(new AuthFeature(IdentityAuth.For<ApplicationUser>(options => {
    //..
    options.IncludeAssignRoleServices = true;
})));

Admin Users can use the AssignRoles and UnAssignRoles APIs to assign roles to users. There’s no public API for creating new roles only assigning existing roles.