Remove permission check

Ensured via the controller, see https://github.com/btcpayserver/btcpayserver/pull/2469#discussion_r616289628
This commit is contained in:
Dennis Reimann 2021-04-20 09:10:23 +02:00
parent aef06c7f61
commit 962c80fff8
No known key found for this signature in database
GPG key ID: 5009E1797F03F8D0

View file

@ -144,19 +144,12 @@ namespace BTCPayServer.Controllers
if (lightning == null)
return NotFound();
if (!User.IsInRole(Roles.ServerAdmin))
{
TempData[WellKnownTempData.ErrorMessage] = $"Only the server admin can {(enabled ? "enable" : "disable")} the lightning node";
}
else
{
var paymentMethodId = new PaymentMethodId(network.CryptoCode, PaymentTypes.LightningLike);
var storeBlob = store.GetStoreBlob();
storeBlob.SetExcluded(paymentMethodId, !enabled);
store.SetStoreBlob(storeBlob);
await _Repo.UpdateStore(store);
TempData[WellKnownTempData.SuccessMessage] = $"{network.CryptoCode} Lightning payments are now {(enabled ? "enabled" : "disabled")} for this store.";
}
var paymentMethodId = new PaymentMethodId(network.CryptoCode, PaymentTypes.LightningLike);
var storeBlob = store.GetStoreBlob();
storeBlob.SetExcluded(paymentMethodId, !enabled);
store.SetStoreBlob(storeBlob);
await _Repo.UpdateStore(store);
TempData[WellKnownTempData.SuccessMessage] = $"{network.CryptoCode} Lightning payments are now {(enabled ? "enabled" : "disabled")} for this store.";
return RedirectToAction(nameof(UpdateStore), new { storeId });
}