Skip to content

Commit

Permalink
Move to Roles
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Mar 15, 2024
1 parent b32cfb3 commit 3d6844d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
10 changes: 0 additions & 10 deletions MyApp.ServiceModel/AppRoles.cs

This file was deleted.

4 changes: 2 additions & 2 deletions MyApp.ServiceModel/Roles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
public class Roles
{
public const string Admin = nameof(Admin);
public const string Manager = nameof(Manager);
public const string Employee = nameof(Employee);
public const string Moderator = nameof(Moderator);
public static string[] All { get; set; } = [Admin, Moderator];
}
2 changes: 1 addition & 1 deletion MyApp/Configure.Db.Migrations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private async Task AddSeedUsers(IServiceProvider services)
//initializing custom roles
var roleManager = services.GetRequiredService<RoleManager<IdentityRole>>();
var userManager = services.GetRequiredService<UserManager<ApplicationUser>>();
string[] allRoles = [Roles.Admin, Roles.Manager, Roles.Employee];
string[] allRoles = Roles.All;

void assertResult(IdentityResult result)
{
Expand Down

0 comments on commit 3d6844d

Please sign in to comment.