fix create edit delete permissions

This commit is contained in:
Tiago vasconcelos 2022-07-12 15:29:46 +01:00
parent 2fed92e69a
commit b11597b0de
2 changed files with 8 additions and 3 deletions

View file

@ -1079,7 +1079,7 @@ new Vue({
.request(
'DELETE',
'/diagonalley/api/v1/stalls/' + stallId,
_.findWhere(self.g.user.wallets, {id: stall.wallet}).inkey
_.findWhere(self.g.user.wallets, {id: stall.wallet}).adminkey
)
.then(function (response) {
self.stalls = _.reject(self.stalls, function (obj) {

View file

@ -9,7 +9,12 @@ from starlette.exceptions import HTTPException
from lnbits.core.crud import get_user
from lnbits.core.services import create_invoice
from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key
from lnbits.decorators import (
WalletTypeInfo,
get_key_type,
require_admin_key,
require_invoice_key,
)
from . import db, diagonalley_ext
from .crud import (
@ -186,7 +191,7 @@ async def api_diagonalley_stalls(
async def api_diagonalley_stall_create(
data: createStalls,
stall_id: str = Query(None),
wallet: WalletTypeInfo = Depends(get_key_type),
wallet: WalletTypeInfo = Depends(require_invoice_key),
):
if stall_id: