From 3bad5883bb8500e466416f45be50aa2613b588e4 Mon Sep 17 00:00:00 2001 From: d11n Date: Thu, 12 Sep 2024 03:02:37 +0200 Subject: [PATCH] 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` --- .../20240904092905_UpdateStoreOwnerRole.cs | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 BTCPayServer.Data/Migrations/20240904092905_UpdateStoreOwnerRole.cs diff --git a/BTCPayServer.Data/Migrations/20240904092905_UpdateStoreOwnerRole.cs b/BTCPayServer.Data/Migrations/20240904092905_UpdateStoreOwnerRole.cs new file mode 100644 index 000000000..52963173b --- /dev/null +++ b/BTCPayServer.Data/Migrations/20240904092905_UpdateStoreOwnerRole.cs @@ -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" + } + }); + } + } +}