Permissions: Remove deprecated custodian account policies (#6193)

Updates the store owner role and removes these three deprecated policies:

- `btcpay.store.cantradecustodianaccount`
- `btcpay.store.canwithdrawfromcustodianaccount`
- `btcpay.store.candeposittocustodianaccount`
This commit is contained in:
d11n 2024-09-12 03:02:37 +02:00 committed by GitHub
parent d4c30866b7
commit 3bad5883bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,54 @@
using BTCPayServer.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Newtonsoft.Json;
#nullable disable
namespace BTCPayServer.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20240904092905_UpdateStoreOwnerRole")]
public partial class UpdateStoreOwnerRole : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
"StoreRoles",
keyColumns: new[] { "Id" },
keyColumnTypes: new[] { "TEXT" },
keyValues: new[] { "Owner" },
columns: new[] { "Permissions" },
columnTypes: new[] { "TEXT[]" },
values: new object[]
{
new[]
{
"btcpay.store.canmodifystoresettings"
}
});
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
"StoreRoles",
keyColumns: new[] { "Id" },
keyColumnTypes: new[] { "TEXT" },
keyValues: new[] { "Owner" },
columns: new[] { "Permissions" },
columnTypes: new[] { "TEXT[]" },
values: new object[]
{
new[]
{
"btcpay.store.canmodifystoresettings",
"btcpay.store.cantradecustodianaccount",
"btcpay.store.canwithdrawfromcustodianaccount",
"btcpay.store.candeposittocustodianaccount"
}
});
}
}
}