mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 06:21:44 +01:00
Don't adjust store mode if user is performing an action
This commit is contained in:
parent
3dc663f4d8
commit
82675384c4
1 changed files with 8 additions and 0 deletions
|
@ -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)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue