mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Don't adjust store mode if user is performing an action
This commit is contained in:
committed by
Andrew Camilleri
parent
3dc663f4d8
commit
82675384c4
@@ -228,6 +228,14 @@ namespace BTCPayServer.Controllers
|
|||||||
}
|
}
|
||||||
else if (wanted?.Any() ?? false)
|
else if (wanted?.Any() ?? false)
|
||||||
{
|
{
|
||||||
|
var commandParts = vm.Command?.Split(':', StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty<string>();
|
||||||
|
var command = commandParts.Length > 1 ? commandParts[1] : null;
|
||||||
|
var isPerformingAnAction = command == "change-store-mode" || command == "add-store";
|
||||||
|
// Don't want to accidentally change mode for the user if they are explicitly performing some action
|
||||||
|
if (isPerformingAnAction) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (vm.SelectiveStores && Policies.IsStorePolicy(permissionValue.Permission) &&
|
if (vm.SelectiveStores && Policies.IsStorePolicy(permissionValue.Permission) &&
|
||||||
wanted.Any(permission => !string.IsNullOrEmpty(permission.Scope)))
|
wanted.Any(permission => !string.IsNullOrEmpty(permission.Scope)))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user