aggiunte tabelle di destinazione + seed userRoles
This commit is contained in:
@@ -35,8 +35,9 @@ namespace WebDoorCreator.Data
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
|
||||
builder.ApplyConfiguration(new RoleConfiguration());
|
||||
builder.ApplyConfiguration(new UserConfiguration());
|
||||
//builder.ApplyConfiguration(new RoleConfiguration());
|
||||
//builder.ApplyConfiguration(new UserConfiguration());
|
||||
builder.ApplyConfiguration(new UserRolesConfiguration());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace WebDoorCreator.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="userId">User id to search for</param>
|
||||
/// <returns></returns>
|
||||
public List<UserRoleClaimDTO> GetUserRoleClamByUserId()
|
||||
public List<UserRoleClaimDTO> GetUserRoleClaimByUserId()
|
||||
{
|
||||
List<UserRoleClaimDTO> dbResult = new List<UserRoleClaimDTO>();
|
||||
using (WDCDataContext localDbCtx = new WDCDataContext(_configuration))
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace WebDoorCreator.Data.DbModels
|
||||
{
|
||||
[Table("AspNetRoles")]
|
||||
public class RolesModel
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace WebDoorCreator.Data.DbModels
|
||||
{
|
||||
[Table("AspNetUserRoles")]
|
||||
public class UserRolesModel
|
||||
{
|
||||
public string UserId { get; set; } = "";
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace WebDoorCreator.Data.DbModels
|
||||
{
|
||||
[Table("AspNetUsers")]
|
||||
public class UsersModel
|
||||
{
|
||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
@@ -26,5 +27,8 @@ namespace WebDoorCreator.Data.DbModels
|
||||
public DateTimeOffset? LockoutEnd { get; set; } = null;
|
||||
public bool LockoutEnabled { get; set; } = false;
|
||||
public int AccessFailedCount { get; set; } = 0 ;
|
||||
|
||||
[ForeignKey("RoleId")]
|
||||
protected virtual RolesModel? RolesNav { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using WebDoorCreator.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WebDoorCreator.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20230313081642_seedUserRoles")]
|
||||
partial class seedUserRoles
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.14")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex")
|
||||
.HasFilter("[NormalizedName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "7d3b9719-8a33-4790-b0ce-9df3552458f3",
|
||||
ConcurrencyStamp = "f271ed2d-48dc-4293-b485-15cfb28b3ce7",
|
||||
Name = "Undef",
|
||||
NormalizedName = "UNDEF"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "f66a9c0f-9f6b-4d9d-89d0-bde432a94882",
|
||||
ConcurrencyStamp = "5e10ccc3-4f63-4c52-a523-87a4f7dcbd92",
|
||||
Name = "SuperAdmin",
|
||||
NormalizedName = "SUPERADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "4225aeef-4a9b-4629-bbb2-4f3ea6c93595",
|
||||
ConcurrencyStamp = "2a53a882-ccfd-46f5-8c31-04e5945bfc07",
|
||||
Name = "Admin",
|
||||
NormalizedName = "ADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5",
|
||||
ConcurrencyStamp = "97a20c80-6755-44c0-af54-79310eff8c49",
|
||||
Name = "CompAdmin",
|
||||
NormalizedName = "COMPADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "820b2520-2f28-47cc-8453-ea6871f6e0e6",
|
||||
ConcurrencyStamp = "0ea8eb3e-972e-4a40-b265-f892335e3db0",
|
||||
Name = "CompUser",
|
||||
NormalizedName = "COMPUSER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "7f512221-c37f-438c-920a-76458e217611",
|
||||
ConcurrencyStamp = "315f6b4a-8700-4ae7-a74b-37a70fbc1c90",
|
||||
Name = "User",
|
||||
NormalizedName = "USER"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex")
|
||||
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetUsers", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "0e340d8e-13ae-4468-ac08-ad56b5f8beb0",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "99b889ee-f2e0-4a35-b634-cded15ae1202",
|
||||
Email = "zaccaria.majid@egalware.com",
|
||||
EmailConfirmed = true,
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "ZACCARIA.MAJID@EGALWARE.COM",
|
||||
NormalizedUserName = "ZACCARIA.MAJID@EGALWARE.COM",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAEP4S1t7nQ7I43c+BoIwzhu+bIJnr4qAkxquYB39B2hipXH4vPMChvlGXhdmSzoE+bA==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "f624ca4f-a973-47c0-b7cd-7205a6b22b80",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "zaccaria.majid@egalware.com"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "d2cfd57e-cfa8-466d-bd47-09264eccf22e",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "b0893391-d39d-49fb-aa72-6a2bb724cf6f",
|
||||
Email = "samuele.locatelli@egalware.com",
|
||||
EmailConfirmed = true,
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||
NormalizedUserName = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAEH9W4UW0rxoevxgL5YvfdPouQCKCtbqhOKLI4hVC8Y8NL9vB67gN3Ssjoiifa6pIyQ==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "491eab90-49a1-45a0-8fde-b4cf6ecfc148",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "samuele.locatelli@egalware.com"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "36562ca7-5ede-4e04-8971-1acd9e4fb9e6",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "0af78587-a6d1-4447-9a99-aeec5ed4439f",
|
||||
Email = "zaccaria.majid01@egalware.com",
|
||||
EmailConfirmed = true,
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "ZACCARIA.MAJID01@EGALWARE.COM",
|
||||
NormalizedUserName = "ZACCARIA.MAJID01@EGALWARE.COM",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAEBkLo5tSygUuaLP+5AzzXujyEMyMlGemSEWwVTwzVxOPkKxhJe/70b3MXixHS/wCfQ==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "13376a9a-9cf2-484a-9915-f0084ca221a5",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "zaccaria.majid01@egalware.com"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "d869584f-f439-4889-aade-b7497f1cb557",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "dd36865e-42ee-4201-bde5-671a747c7df2",
|
||||
Email = "zaccaria.majid02@egalware.com",
|
||||
EmailConfirmed = true,
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "ZACCARIA.MAJID02@EGALWARE.COM",
|
||||
NormalizedUserName = "ZACCARIA.MAJID02@EGALWARE.COM",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAEFvMfeDBv3L70MKJRLCe4XnOzMcFoCLt3dequovqaZN/NwQqeiW3WHBJKJmJuoAqCg==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "355ea3f3-96af-4f8c-ae53-ff501596d6bc",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "zaccaria.majid02@egalware.com"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WebDoorCreator.Data.Migrations
|
||||
{
|
||||
public partial class seedUserRoles : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "0fe4015b-cf98-4229-a120-57eb9c2ca945");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "1f63e241-4a96-437c-9af9-55748e0f6ed5");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "34e09fbe-45db-4225-af17-793b4a0f90a1");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "9dfb7941-838f-483e-b1c2-10e01abb3d2d");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "ade81cd7-b091-4691-96a2-5c29d28bda2e");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "df6b65a0-9b15-49df-b0d0-06b22ef75f08");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "156dadc4-921a-4eee-8358-2cfff737a380");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "16627235-f84e-43c2-8e14-88906a019527");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "33fd9cf3-7621-48ee-9d83-6829b2253795");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "f15d1e26-d995-4c46-86ca-6a67462424f5");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "4225aeef-4a9b-4629-bbb2-4f3ea6c93595", "2a53a882-ccfd-46f5-8c31-04e5945bfc07", "Admin", "ADMIN" },
|
||||
{ "7d3b9719-8a33-4790-b0ce-9df3552458f3", "f271ed2d-48dc-4293-b485-15cfb28b3ce7", "Undef", "UNDEF" },
|
||||
{ "7f512221-c37f-438c-920a-76458e217611", "315f6b4a-8700-4ae7-a74b-37a70fbc1c90", "User", "USER" },
|
||||
{ "820b2520-2f28-47cc-8453-ea6871f6e0e6", "0ea8eb3e-972e-4a40-b265-f892335e3db0", "CompUser", "COMPUSER" },
|
||||
{ "f66a9c0f-9f6b-4d9d-89d0-bde432a94882", "5e10ccc3-4f63-4c52-a523-87a4f7dcbd92", "SuperAdmin", "SUPERADMIN" },
|
||||
{ "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5", "97a20c80-6755-44c0-af54-79310eff8c49", "CompAdmin", "COMPADMIN" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetUsers",
|
||||
columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "0e340d8e-13ae-4468-ac08-ad56b5f8beb0", 0, "99b889ee-f2e0-4a35-b634-cded15ae1202", "zaccaria.majid@egalware.com", true, false, null, "ZACCARIA.MAJID@EGALWARE.COM", "ZACCARIA.MAJID@EGALWARE.COM", "AQAAAAEAACcQAAAAEP4S1t7nQ7I43c+BoIwzhu+bIJnr4qAkxquYB39B2hipXH4vPMChvlGXhdmSzoE+bA==", null, false, "f624ca4f-a973-47c0-b7cd-7205a6b22b80", false, "zaccaria.majid@egalware.com" },
|
||||
{ "36562ca7-5ede-4e04-8971-1acd9e4fb9e6", 0, "0af78587-a6d1-4447-9a99-aeec5ed4439f", "zaccaria.majid01@egalware.com", true, false, null, "ZACCARIA.MAJID01@EGALWARE.COM", "ZACCARIA.MAJID01@EGALWARE.COM", "AQAAAAEAACcQAAAAEBkLo5tSygUuaLP+5AzzXujyEMyMlGemSEWwVTwzVxOPkKxhJe/70b3MXixHS/wCfQ==", null, false, "13376a9a-9cf2-484a-9915-f0084ca221a5", false, "zaccaria.majid01@egalware.com" },
|
||||
{ "d2cfd57e-cfa8-466d-bd47-09264eccf22e", 0, "b0893391-d39d-49fb-aa72-6a2bb724cf6f", "samuele.locatelli@egalware.com", true, false, null, "SAMUELE.LOCATELLI@EGALWARE.COM", "SAMUELE.LOCATELLI@EGALWARE.COM", "AQAAAAEAACcQAAAAEH9W4UW0rxoevxgL5YvfdPouQCKCtbqhOKLI4hVC8Y8NL9vB67gN3Ssjoiifa6pIyQ==", null, false, "491eab90-49a1-45a0-8fde-b4cf6ecfc148", false, "samuele.locatelli@egalware.com" },
|
||||
{ "d869584f-f439-4889-aade-b7497f1cb557", 0, "dd36865e-42ee-4201-bde5-671a747c7df2", "zaccaria.majid02@egalware.com", true, false, null, "ZACCARIA.MAJID02@EGALWARE.COM", "ZACCARIA.MAJID02@EGALWARE.COM", "AQAAAAEAACcQAAAAEFvMfeDBv3L70MKJRLCe4XnOzMcFoCLt3dequovqaZN/NwQqeiW3WHBJKJmJuoAqCg==", null, false, "355ea3f3-96af-4f8c-ae53-ff501596d6bc", false, "zaccaria.majid02@egalware.com" }
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "4225aeef-4a9b-4629-bbb2-4f3ea6c93595");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "7d3b9719-8a33-4790-b0ce-9df3552458f3");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "7f512221-c37f-438c-920a-76458e217611");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "820b2520-2f28-47cc-8453-ea6871f6e0e6");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "f66a9c0f-9f6b-4d9d-89d0-bde432a94882");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "0e340d8e-13ae-4468-ac08-ad56b5f8beb0");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "36562ca7-5ede-4e04-8971-1acd9e4fb9e6");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "d2cfd57e-cfa8-466d-bd47-09264eccf22e");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "d869584f-f439-4889-aade-b7497f1cb557");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "0fe4015b-cf98-4229-a120-57eb9c2ca945", "ccb4b655-3619-463d-a702-d0c9497e772c", "Admin", "ADMIN" },
|
||||
{ "1f63e241-4a96-437c-9af9-55748e0f6ed5", "684c9e79-7c20-4e25-ade2-66529980ef38", "Undef", "UNDEF" },
|
||||
{ "34e09fbe-45db-4225-af17-793b4a0f90a1", "3895c7f6-8f63-4c30-9f93-0af0504f5e91", "CompUser", "COMPUSER" },
|
||||
{ "9dfb7941-838f-483e-b1c2-10e01abb3d2d", "15368102-cd08-46cf-a376-dbbc8c6a8f71", "User", "USER" },
|
||||
{ "ade81cd7-b091-4691-96a2-5c29d28bda2e", "ba17c203-0eea-4549-893f-766dc7b9381f", "CompAdmin", "COMPADMIN" },
|
||||
{ "df6b65a0-9b15-49df-b0d0-06b22ef75f08", "e788b4b6-9f00-449c-a5f8-9105c8bd734e", "SuperAdmin", "SUPERADMIN" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetUsers",
|
||||
columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "156dadc4-921a-4eee-8358-2cfff737a380", 0, "a4af2f48-b477-499c-a925-34e5660d75c9", "zaccaria.majid.01@egalware.com", true, false, null, "ZACCARIA.MAJID.01@EGALWARE.COM", "ZACCARIA.MAJID.01@EGALWARE.COM", "AQAAAAEAACcQAAAAEAD4/IHpZRIdA2g6OZryf6mnaNuTwu73qw8YOTFofAYVEcqyH3aSb4zWTtNUaZT7Fg==", null, false, "3fd2e7bb-56ed-4f0a-8d80-9b7b8f13f504", false, "zaccaria.majid.01@egalware.com" },
|
||||
{ "16627235-f84e-43c2-8e14-88906a019527", 0, "85daf496-3f42-4797-b2e1-a06a3cbbb43b", "zaccaria.majid@egalware.com", true, false, null, "ZACCARIA.MAJID@EGALWARE.COM", "ZACCARIA.MAJID@EGALWARE.COM", "AQAAAAEAACcQAAAAECIETTMPjm03IOW5dZAUeWleVETwFLVU743s1wVAyyL1yZ3GxBU0tNOKzrljjLEDDw==", null, false, "ac24ad17-7896-4a0e-807b-ec7224618c69", false, "zaccaria.majid@egalware.com" },
|
||||
{ "33fd9cf3-7621-48ee-9d83-6829b2253795", 0, "a7e85a3f-0a71-4734-9d94-fbce97f25efd", "zaccaria.majid.02@egalware.com", true, false, null, "ZACCARIA.MAJID.02@EGALWARE.COM", "ZACCARIA.MAJID.02@EGALWARE.COM", "AQAAAAEAACcQAAAAEO5UVGTj7Askab70xopfrff3iYAaGpaWU9n6fkJ+goOSvQmpnpnHeFC4Lk0wagKTtQ==", null, false, "c297cc6d-7405-41b4-89f6-891649fd45e8", false, "zaccaria.majid.02@egalware.com" },
|
||||
{ "f15d1e26-d995-4c46-86ca-6a67462424f5", 0, "1915e8bb-be14-4740-898a-ebfe59b128ff", "samuele.locatelli@egalware.com", true, false, null, "SAMUELE.LOCATELLI@EGALWARE.COM", "SAMUELE.LOCATELLI@EGALWARE.COM", "AQAAAAEAACcQAAAAELF/Z/vSH1yOO3AATBL84KD+GZViNyRbmICrvtNS/IprAm0Va56FXmgxoCTuWVAjwg==", null, false, "55b9e573-b151-47eb-9977-5cffc3de94b7", false, "samuele.locatelli@egalware.com" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
+304
@@ -0,0 +1,304 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using WebDoorCreator.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WebDoorCreator.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20230313082430_seedOnlyUserRoles")]
|
||||
partial class seedOnlyUserRoles
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "6.0.14")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex")
|
||||
.HasFilter("[NormalizedName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetRoleClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("nvarchar(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex")
|
||||
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetUsers", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("AspNetUserLogins", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
UserId = "f15d1e26-d995-4c46-86ca-6a67462424f5",
|
||||
RoleId = "f66a9c0f-9f6b-4d9d-89d0-bde432a94882"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = "0e340d8e-13ae-4468-ac08-ad56b5f8beb0",
|
||||
RoleId = "f66a9c0f-9f6b-4d9d-89d0-bde432a94882"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = "36562ca7-5ede-4e04-8971-1acd9e4fb9e6",
|
||||
RoleId = "4225aeef-4a9b-4629-bbb2-4f3ea6c93595"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = "d869584f-f439-4889-aade-b7497f1cb557",
|
||||
RoleId = "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(128)
|
||||
.HasColumnType("nvarchar(128)");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("AspNetUserTokens", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace WebDoorCreator.Data.Migrations
|
||||
{
|
||||
public partial class seedOnlyUserRoles : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "4225aeef-4a9b-4629-bbb2-4f3ea6c93595");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "7d3b9719-8a33-4790-b0ce-9df3552458f3");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "7f512221-c37f-438c-920a-76458e217611");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "820b2520-2f28-47cc-8453-ea6871f6e0e6");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "f66a9c0f-9f6b-4d9d-89d0-bde432a94882");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "0e340d8e-13ae-4468-ac08-ad56b5f8beb0");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "36562ca7-5ede-4e04-8971-1acd9e4fb9e6");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "d2cfd57e-cfa8-466d-bd47-09264eccf22e");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUsers",
|
||||
keyColumn: "Id",
|
||||
keyValue: "d869584f-f439-4889-aade-b7497f1cb557");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetUserRoles",
|
||||
columns: new[] { "RoleId", "UserId" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "f66a9c0f-9f6b-4d9d-89d0-bde432a94882", "0e340d8e-13ae-4468-ac08-ad56b5f8beb0" },
|
||||
{ "4225aeef-4a9b-4629-bbb2-4f3ea6c93595", "36562ca7-5ede-4e04-8971-1acd9e4fb9e6" },
|
||||
{ "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5", "d869584f-f439-4889-aade-b7497f1cb557" },
|
||||
{ "f66a9c0f-9f6b-4d9d-89d0-bde432a94882", "f15d1e26-d995-4c46-86ca-6a67462424f5" }
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUserRoles",
|
||||
keyColumns: new[] { "RoleId", "UserId" },
|
||||
keyValues: new object[] { "f66a9c0f-9f6b-4d9d-89d0-bde432a94882", "0e340d8e-13ae-4468-ac08-ad56b5f8beb0" });
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUserRoles",
|
||||
keyColumns: new[] { "RoleId", "UserId" },
|
||||
keyValues: new object[] { "4225aeef-4a9b-4629-bbb2-4f3ea6c93595", "36562ca7-5ede-4e04-8971-1acd9e4fb9e6" });
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUserRoles",
|
||||
keyColumns: new[] { "RoleId", "UserId" },
|
||||
keyValues: new object[] { "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5", "d869584f-f439-4889-aade-b7497f1cb557" });
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetUserRoles",
|
||||
keyColumns: new[] { "RoleId", "UserId" },
|
||||
keyValues: new object[] { "f66a9c0f-9f6b-4d9d-89d0-bde432a94882", "f15d1e26-d995-4c46-86ca-6a67462424f5" });
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "4225aeef-4a9b-4629-bbb2-4f3ea6c93595", "2a53a882-ccfd-46f5-8c31-04e5945bfc07", "Admin", "ADMIN" },
|
||||
{ "7d3b9719-8a33-4790-b0ce-9df3552458f3", "f271ed2d-48dc-4293-b485-15cfb28b3ce7", "Undef", "UNDEF" },
|
||||
{ "7f512221-c37f-438c-920a-76458e217611", "315f6b4a-8700-4ae7-a74b-37a70fbc1c90", "User", "USER" },
|
||||
{ "820b2520-2f28-47cc-8453-ea6871f6e0e6", "0ea8eb3e-972e-4a40-b265-f892335e3db0", "CompUser", "COMPUSER" },
|
||||
{ "f66a9c0f-9f6b-4d9d-89d0-bde432a94882", "5e10ccc3-4f63-4c52-a523-87a4f7dcbd92", "SuperAdmin", "SUPERADMIN" },
|
||||
{ "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5", "97a20c80-6755-44c0-af54-79310eff8c49", "CompAdmin", "COMPADMIN" }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetUsers",
|
||||
columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ "0e340d8e-13ae-4468-ac08-ad56b5f8beb0", 0, "99b889ee-f2e0-4a35-b634-cded15ae1202", "zaccaria.majid@egalware.com", true, false, null, "ZACCARIA.MAJID@EGALWARE.COM", "ZACCARIA.MAJID@EGALWARE.COM", "AQAAAAEAACcQAAAAEP4S1t7nQ7I43c+BoIwzhu+bIJnr4qAkxquYB39B2hipXH4vPMChvlGXhdmSzoE+bA==", null, false, "f624ca4f-a973-47c0-b7cd-7205a6b22b80", false, "zaccaria.majid@egalware.com" },
|
||||
{ "36562ca7-5ede-4e04-8971-1acd9e4fb9e6", 0, "0af78587-a6d1-4447-9a99-aeec5ed4439f", "zaccaria.majid01@egalware.com", true, false, null, "ZACCARIA.MAJID01@EGALWARE.COM", "ZACCARIA.MAJID01@EGALWARE.COM", "AQAAAAEAACcQAAAAEBkLo5tSygUuaLP+5AzzXujyEMyMlGemSEWwVTwzVxOPkKxhJe/70b3MXixHS/wCfQ==", null, false, "13376a9a-9cf2-484a-9915-f0084ca221a5", false, "zaccaria.majid01@egalware.com" },
|
||||
{ "d2cfd57e-cfa8-466d-bd47-09264eccf22e", 0, "b0893391-d39d-49fb-aa72-6a2bb724cf6f", "samuele.locatelli@egalware.com", true, false, null, "SAMUELE.LOCATELLI@EGALWARE.COM", "SAMUELE.LOCATELLI@EGALWARE.COM", "AQAAAAEAACcQAAAAEH9W4UW0rxoevxgL5YvfdPouQCKCtbqhOKLI4hVC8Y8NL9vB67gN3Ssjoiifa6pIyQ==", null, false, "491eab90-49a1-45a0-8fde-b4cf6ecfc148", false, "samuele.locatelli@egalware.com" },
|
||||
{ "d869584f-f439-4889-aade-b7497f1cb557", 0, "dd36865e-42ee-4201-bde5-671a747c7df2", "zaccaria.majid02@egalware.com", true, false, null, "ZACCARIA.MAJID02@EGALWARE.COM", "ZACCARIA.MAJID02@EGALWARE.COM", "AQAAAAEAACcQAAAAEFvMfeDBv3L70MKJRLCe4XnOzMcFoCLt3dequovqaZN/NwQqeiW3WHBJKJmJuoAqCg==", null, false, "355ea3f3-96af-4f8c-ae53-ff501596d6bc", false, "zaccaria.majid02@egalware.com" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,50 +47,6 @@ namespace WebDoorCreator.Data.Migrations
|
||||
.HasFilter("[NormalizedName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "1f63e241-4a96-437c-9af9-55748e0f6ed5",
|
||||
ConcurrencyStamp = "684c9e79-7c20-4e25-ade2-66529980ef38",
|
||||
Name = "Undef",
|
||||
NormalizedName = "UNDEF"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "df6b65a0-9b15-49df-b0d0-06b22ef75f08",
|
||||
ConcurrencyStamp = "e788b4b6-9f00-449c-a5f8-9105c8bd734e",
|
||||
Name = "SuperAdmin",
|
||||
NormalizedName = "SUPERADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "0fe4015b-cf98-4229-a120-57eb9c2ca945",
|
||||
ConcurrencyStamp = "ccb4b655-3619-463d-a702-d0c9497e772c",
|
||||
Name = "Admin",
|
||||
NormalizedName = "ADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "ade81cd7-b091-4691-96a2-5c29d28bda2e",
|
||||
ConcurrencyStamp = "ba17c203-0eea-4549-893f-766dc7b9381f",
|
||||
Name = "CompAdmin",
|
||||
NormalizedName = "COMPADMIN"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "34e09fbe-45db-4225-af17-793b4a0f90a1",
|
||||
ConcurrencyStamp = "3895c7f6-8f63-4c30-9f93-0af0504f5e91",
|
||||
Name = "CompUser",
|
||||
NormalizedName = "COMPUSER"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "9dfb7941-838f-483e-b1c2-10e01abb3d2d",
|
||||
ConcurrencyStamp = "15368102-cd08-46cf-a376-dbbc8c6a8f71",
|
||||
Name = "User",
|
||||
NormalizedName = "USER"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
@@ -181,72 +137,6 @@ namespace WebDoorCreator.Data.Migrations
|
||||
.HasFilter("[NormalizedUserName] IS NOT NULL");
|
||||
|
||||
b.ToTable("AspNetUsers", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = "16627235-f84e-43c2-8e14-88906a019527",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "85daf496-3f42-4797-b2e1-a06a3cbbb43b",
|
||||
Email = "zaccaria.majid@egalware.com",
|
||||
EmailConfirmed = true,
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "ZACCARIA.MAJID@EGALWARE.COM",
|
||||
NormalizedUserName = "ZACCARIA.MAJID@EGALWARE.COM",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAECIETTMPjm03IOW5dZAUeWleVETwFLVU743s1wVAyyL1yZ3GxBU0tNOKzrljjLEDDw==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "ac24ad17-7896-4a0e-807b-ec7224618c69",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "zaccaria.majid@egalware.com"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "f15d1e26-d995-4c46-86ca-6a67462424f5",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "1915e8bb-be14-4740-898a-ebfe59b128ff",
|
||||
Email = "samuele.locatelli@egalware.com",
|
||||
EmailConfirmed = true,
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||
NormalizedUserName = "SAMUELE.LOCATELLI@EGALWARE.COM",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAELF/Z/vSH1yOO3AATBL84KD+GZViNyRbmICrvtNS/IprAm0Va56FXmgxoCTuWVAjwg==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "55b9e573-b151-47eb-9977-5cffc3de94b7",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "samuele.locatelli@egalware.com"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "156dadc4-921a-4eee-8358-2cfff737a380",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "a4af2f48-b477-499c-a925-34e5660d75c9",
|
||||
Email = "zaccaria.majid.01@egalware.com",
|
||||
EmailConfirmed = true,
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "ZACCARIA.MAJID.01@EGALWARE.COM",
|
||||
NormalizedUserName = "ZACCARIA.MAJID.01@EGALWARE.COM",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAEAD4/IHpZRIdA2g6OZryf6mnaNuTwu73qw8YOTFofAYVEcqyH3aSb4zWTtNUaZT7Fg==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "3fd2e7bb-56ed-4f0a-8d80-9b7b8f13f504",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "zaccaria.majid.01@egalware.com"
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = "33fd9cf3-7621-48ee-9d83-6829b2253795",
|
||||
AccessFailedCount = 0,
|
||||
ConcurrencyStamp = "a7e85a3f-0a71-4734-9d94-fbce97f25efd",
|
||||
Email = "zaccaria.majid.02@egalware.com",
|
||||
EmailConfirmed = true,
|
||||
LockoutEnabled = false,
|
||||
NormalizedEmail = "ZACCARIA.MAJID.02@EGALWARE.COM",
|
||||
NormalizedUserName = "ZACCARIA.MAJID.02@EGALWARE.COM",
|
||||
PasswordHash = "AQAAAAEAACcQAAAAEO5UVGTj7Askab70xopfrff3iYAaGpaWU9n6fkJ+goOSvQmpnpnHeFC4Lk0wagKTtQ==",
|
||||
PhoneNumberConfirmed = false,
|
||||
SecurityStamp = "c297cc6d-7405-41b4-89f6-891649fd45e8",
|
||||
TwoFactorEnabled = false,
|
||||
UserName = "zaccaria.majid.02@egalware.com"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
@@ -311,6 +201,28 @@ namespace WebDoorCreator.Data.Migrations
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
UserId = "f15d1e26-d995-4c46-86ca-6a67462424f5",
|
||||
RoleId = "f66a9c0f-9f6b-4d9d-89d0-bde432a94882"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = "0e340d8e-13ae-4468-ac08-ad56b5f8beb0",
|
||||
RoleId = "f66a9c0f-9f6b-4d9d-89d0-bde432a94882"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = "36562ca7-5ede-4e04-8971-1acd9e4fb9e6",
|
||||
RoleId = "4225aeef-4a9b-4629-bbb2-4f3ea6c93595"
|
||||
},
|
||||
new
|
||||
{
|
||||
UserId = "d869584f-f439-4889-aade-b7497f1cb557",
|
||||
RoleId = "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5"
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace WebDoorCreator.Data.Migrations.WDCData
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("IdentityRole");
|
||||
b.ToTable("IdentityRole", (string)null);
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
@@ -139,7 +139,7 @@ namespace WebDoorCreator.Data.Migrations.WDCData
|
||||
|
||||
b.HasKey("CompanyId");
|
||||
|
||||
b.ToTable("Company");
|
||||
b.ToTable("Company", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorModel", b =>
|
||||
@@ -190,7 +190,7 @@ namespace WebDoorCreator.Data.Migrations.WDCData
|
||||
|
||||
b.HasIndex("TypeId");
|
||||
|
||||
b.ToTable("Door");
|
||||
b.ToTable("Door", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.DoorTypeModel", b =>
|
||||
@@ -211,7 +211,7 @@ namespace WebDoorCreator.Data.Migrations.WDCData
|
||||
|
||||
b.HasKey("TypeId");
|
||||
|
||||
b.ToTable("DoorType");
|
||||
b.ToTable("DoorType", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.OrderModel", b =>
|
||||
@@ -254,7 +254,7 @@ namespace WebDoorCreator.Data.Migrations.WDCData
|
||||
|
||||
b.HasIndex("CompanyId");
|
||||
|
||||
b.ToTable("Order");
|
||||
b.ToTable("Order", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("WebDoorCreator.Data.DbModels.RolesModel", b =>
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace WebDoorCreator.Data
|
||||
{
|
||||
public class UserRolesConfiguration : IEntityTypeConfiguration<IdentityUserRole<string>>
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
public void Configure(EntityTypeBuilder<IdentityUserRole<string>> builder)
|
||||
{
|
||||
|
||||
// Default seeded users
|
||||
builder.HasData(
|
||||
//SuperAdmin Samuele
|
||||
seedUserRoles("f15d1e26-d995-4c46-86ca-6a67462424f5", "f66a9c0f-9f6b-4d9d-89d0-bde432a94882"),
|
||||
//SuperAdmin Zaccaria
|
||||
seedUserRoles("0e340d8e-13ae-4468-ac08-ad56b5f8beb0", "f66a9c0f-9f6b-4d9d-89d0-bde432a94882"),
|
||||
//Admin Zaccaria 01
|
||||
seedUserRoles("36562ca7-5ede-4e04-8971-1acd9e4fb9e6", "4225aeef-4a9b-4629-bbb2-4f3ea6c93595"),
|
||||
//CompAdmin Zaccaria 02
|
||||
seedUserRoles("d869584f-f439-4889-aade-b7497f1cb557", "fc7d40cd-35d6-45a1-89b6-ac4ffa6368c5")
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected IdentityUserRole<string> seedUserRoles(string userID, string roleId)
|
||||
{
|
||||
var newRec = new IdentityUserRole<string>()
|
||||
{
|
||||
UserId = userID,
|
||||
RoleId = roleId
|
||||
};
|
||||
|
||||
|
||||
return newRec;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace WebDoorCreator.UI.Components
|
||||
{
|
||||
ListRecords = null;
|
||||
await Task.Delay(1);
|
||||
UsersList = await WDService.GetUserRoleClamByUserId();
|
||||
UsersList = await WDService.GetUserRoleClaimByUserId();
|
||||
await Task.Delay(1);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace WebDoorCreator.UI.Data
|
||||
/// <summary>
|
||||
/// Users roles DTO list
|
||||
/// </summary>
|
||||
public async Task<List<UserRoleClaimDTO>?> GetUserRoleClamByUserId()
|
||||
public async Task<List<UserRoleClaimDTO>?> GetUserRoleClaimByUserId()
|
||||
{
|
||||
string source = "DB";
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace WebDoorCreator.UI.Data
|
||||
}
|
||||
else
|
||||
{
|
||||
dbResult = dbController.GetUserRoleClamByUserId();
|
||||
dbResult = dbController.GetUserRoleClaimByUserId();
|
||||
rawData = JsonConvert.SerializeObject(dbResult, JSSettings);
|
||||
await redisDb.StringSetAsync(currKey, rawData, UltraLongCache);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user