Merge pull request 'fix/#37333881-critical-message-permission' (#326) from fix/#37333881-critical-message-permission into dev

Reviewed-on: https://test.digitaldrilling.ru:8443/DDrilling/AsbCloudServer/pulls/326
This commit is contained in:
Никита Фролов 2024-09-18 11:28:17 +05:00
commit 6646a38366
5 changed files with 12440 additions and 1 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace AsbCloudDb.Migrations
{
/// <inheritdoc />
public partial class Add_Permission_Critical_Message : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "t_permission",
columns: new[] { "id", "description", "name" },
values: new object[] { 533, "Разрешение просматривать критические сообщения", "CriticalMessage.get" });
migrationBuilder.InsertData(
table: "t_relation_user_role_permission",
columns: new[] { "id_permission", "id_user_role" },
values: new object[] { 533, 1 });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "t_relation_user_role_permission",
keyColumns: new[] { "id_permission", "id_user_role" },
keyValues: new object[] { 533, 1 });
migrationBuilder.DeleteData(
table: "t_permission",
keyColumn: "id",
keyValue: 533);
}
}
}

View File

@ -2632,6 +2632,12 @@ namespace AsbCloudDb.Migrations
Id = 532,
Description = "Разрешение просматривать информацию о телеметрии",
Name = "Version.get"
},
new
{
Id = 533,
Description = "Разрешение просматривать критические сообщения",
Name = "CriticalMessage.get"
});
});
@ -6377,6 +6383,11 @@ namespace AsbCloudDb.Migrations
{
IdUserRole = 1,
IdPermission = 532
},
new
{
IdUserRole = 1,
IdPermission = 533
});
});

View File

@ -165,7 +165,8 @@ namespace AsbCloudDb.Model.DefaultData
new() { Id = 530, Name = "WellSectionPlan.edit", Description = "Разрешение на редактирование плановой конструкции скважины"},
new() { Id = 531, Name = "WellSectionPlan.delete", Description = "Разрешение на удаление плановой конструкции скважины"},
new() { Id = 532, Name = "Version.get", Description = "Разрешение просматривать информацию о телеметрии"}
new() { Id = 532, Name = "Version.get", Description = "Разрешение просматривать информацию о телеметрии"},
new() { Id = 533, Name = "CriticalMessage.get", Description = "Разрешение просматривать критические сообщения"}
};
}
}

View File

@ -65,6 +65,7 @@ public class MessageController : ControllerBase
}
[HttpGet("/api/serviceOperation/[controller]")]
[Permission("CriticalMessage.get")]
[ProducesResponseType(typeof(IEnumerable<StatCriticalMessageDto>), (int)System.Net.HttpStatusCode.OK)]
public async Task<IActionResult> Get([FromQuery] MessageRequest request, CancellationToken token)
{