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.