Add btcpay.store.cancreateinvoice claim, and use that for the store

This commit is contained in:
nicolas.dorier
2018-09-08 14:32:26 +09:00
parent e86b4d89ca
commit fed53661b3
14 changed files with 44 additions and 43 deletions

View File

@@ -62,6 +62,8 @@ namespace BTCPayServer.Controllers
internal async Task<DataWrapper<InvoiceResponse>> CreateInvoiceCore(Invoice invoice, StoreData store, string serverUrl)
{
if (!store.HasClaim(Policies.CanCreateInvoice.Key))
throw new UnauthorizedAccessException();
InvoiceLogs logs = new InvoiceLogs();
logs.Write("Creation of invoice starting");
var entity = new InvoiceEntity