forked from ddrilling/AsbCloudServer
Изменение в миграции на добавление разрешений для просмотра / редактирования контактной информации по сквуажине
This commit is contained in:
parent
f210a3c88c
commit
0a2feb9b32
@ -1,53 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace AsbCloudDb.Migrations
|
|
||||||
{
|
|
||||||
public partial class Add_Permissions_RelationContactWell : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.InsertData(
|
|
||||||
table: "t_permission",
|
|
||||||
columns: new[] { "id", "description", "name" },
|
|
||||||
values: new object[,]
|
|
||||||
{
|
|
||||||
{ 519, "Разрешение просматривать список контактов", "RelationContactWell.get" },
|
|
||||||
{ 520, "Разрешение редактировать список контактов", "RelationContactWell.edit" }
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.InsertData(
|
|
||||||
table: "t_relation_user_role_permission",
|
|
||||||
columns: new[] { "id_permission", "id_user_role" },
|
|
||||||
values: new object[,]
|
|
||||||
{
|
|
||||||
{ 519, 1 },
|
|
||||||
{ 520, 1 }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DeleteData(
|
|
||||||
table: "t_relation_user_role_permission",
|
|
||||||
keyColumns: new[] { "id_permission", "id_user_role" },
|
|
||||||
keyValues: new object[] { 519, 1 });
|
|
||||||
|
|
||||||
migrationBuilder.DeleteData(
|
|
||||||
table: "t_relation_user_role_permission",
|
|
||||||
keyColumns: new[] { "id_permission", "id_user_role" },
|
|
||||||
keyValues: new object[] { 520, 1 });
|
|
||||||
|
|
||||||
migrationBuilder.DeleteData(
|
|
||||||
table: "t_permission",
|
|
||||||
keyColumn: "id",
|
|
||||||
keyValue: 519);
|
|
||||||
|
|
||||||
migrationBuilder.DeleteData(
|
|
||||||
table: "t_permission",
|
|
||||||
keyColumn: "id",
|
|
||||||
keyValue: 520);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -13,8 +13,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace AsbCloudDb.Migrations
|
namespace AsbCloudDb.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(AsbCloudDbContext))]
|
[DbContext(typeof(AsbCloudDbContext))]
|
||||||
[Migration("20230626064513_Add_Permissions_RelationContactWell")]
|
[Migration("20230628043716_Add_Permissions_WellContact")]
|
||||||
partial class Add_Permissions_RelationContactWell
|
partial class Add_Permissions_WellContact
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
@ -2009,13 +2009,13 @@ namespace AsbCloudDb.Migrations
|
|||||||
{
|
{
|
||||||
Id = 519,
|
Id = 519,
|
||||||
Description = "Разрешение просматривать список контактов",
|
Description = "Разрешение просматривать список контактов",
|
||||||
Name = "RelationContactWell.get"
|
Name = "WellContact.get"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = 520,
|
Id = 520,
|
||||||
Description = "Разрешение редактировать список контактов",
|
Description = "Разрешение редактировать список контактов",
|
||||||
Name = "RelationContactWell.edit"
|
Name = "WellContact.edit"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -0,0 +1,34 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace AsbCloudDb.Migrations
|
||||||
|
{
|
||||||
|
public partial class Add_Permissions_WellContact : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.InsertData(
|
||||||
|
table: "t_permission",
|
||||||
|
columns: new[] { "id", "description", "name" },
|
||||||
|
values: new object[,]
|
||||||
|
{
|
||||||
|
{ 519, "Разрешение просматривать список контактов", "WellContact.get" },
|
||||||
|
{ 520, "Разрешение редактировать список контактов", "WellContact.edit" }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DeleteData(
|
||||||
|
table: "t_permission",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: 519);
|
||||||
|
|
||||||
|
migrationBuilder.DeleteData(
|
||||||
|
table: "t_permission",
|
||||||
|
keyColumn: "id",
|
||||||
|
keyValue: 520);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2007,13 +2007,13 @@ namespace AsbCloudDb.Migrations
|
|||||||
{
|
{
|
||||||
Id = 519,
|
Id = 519,
|
||||||
Description = "Разрешение просматривать список контактов",
|
Description = "Разрешение просматривать список контактов",
|
||||||
Name = "RelationContactWell.get"
|
Name = "WellContact.get"
|
||||||
},
|
},
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Id = 520,
|
Id = 520,
|
||||||
Description = "Разрешение редактировать список контактов",
|
Description = "Разрешение редактировать список контактов",
|
||||||
Name = "RelationContactWell.edit"
|
Name = "WellContact.edit"
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -150,8 +150,8 @@
|
|||||||
new (){ Id = 517, Name="FaqStatistics.edit", Description="Разрешение редактировать вопрос"},
|
new (){ Id = 517, Name="FaqStatistics.edit", Description="Разрешение редактировать вопрос"},
|
||||||
new (){ Id = 518, Name="FaqStatistics.delete", Description="Разрешение удалять вопрос"},
|
new (){ Id = 518, Name="FaqStatistics.delete", Description="Разрешение удалять вопрос"},
|
||||||
|
|
||||||
new (){ Id = 519, Name="RelationContactWell.get", Description="Разрешение просматривать список контактов"},
|
new (){ Id = 519, Name="WellContact.get", Description="Разрешение просматривать список контактов"},
|
||||||
new (){ Id = 520, Name="RelationContactWell.edit", Description="Разрешение редактировать список контактов"},
|
new (){ Id = 520, Name="WellContact.edit", Description="Разрешение редактировать список контактов"},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using AsbCloudApp.Data;
|
using AsbCloudApp.Data;
|
||||||
using AsbCloudApp.Data.User;
|
|
||||||
using AsbCloudApp.Services;
|
using AsbCloudApp.Services;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
Loading…
Reference in New Issue
Block a user