fix check_admin issue, wrong condition
This commit is contained in:
parent
d2cd972663
commit
aafb2335a1
1 changed files with 1 additions and 4 deletions
|
|
@ -246,10 +246,7 @@ async def check_user_exists(usr: UUID4) -> User:
|
||||||
|
|
||||||
async def check_admin(usr: UUID4) -> User:
|
async def check_admin(usr: UUID4) -> User:
|
||||||
user = await check_user_exists(usr)
|
user = await check_user_exists(usr)
|
||||||
if user.id != settings.super_user or (
|
if user.id != settings.super_user and not user.id in settings.lnbits_admin_users:
|
||||||
len(settings.lnbits_admin_users) > 0
|
|
||||||
and not user.id in settings.lnbits_admin_users
|
|
||||||
):
|
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=HTTPStatus.UNAUTHORIZED,
|
status_code=HTTPStatus.UNAUTHORIZED,
|
||||||
detail="User not authorized. No admin privileges.",
|
detail="User not authorized. No admin privileges.",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue