From d709334180030fcea03b75bf93d6df2f0c65039c Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 5 Oct 2022 20:09:20 -0700 Subject: [PATCH] lottery permissions --- files/helpers/const.py | 2 ++ files/routes/lottery.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index fbc2d766c..39db2e7f1 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -138,6 +138,8 @@ PERMS = { # Minimum admin_level to perform action. 'VIEW_PENDING_SUBMITTED_MARSEYS': 3, 'VIEW_PENDING_SUBMITTED_HATS': 3, 'BUY_GHOST_AWARD': 2, + 'LOTTERY_ADMIN': 3, + 'LOTTERY_VIEW_PARTICIPANTS': 2, } FEATURES = { diff --git a/files/routes/lottery.py b/files/routes/lottery.py index dfb87d207..3546d1517 100644 --- a/files/routes/lottery.py +++ b/files/routes/lottery.py @@ -8,7 +8,7 @@ from files.helpers.lottery import * import requests @app.post("/lottery/end") -@admin_level_required(3) +@admin_level_required(PERMS['LOTTERY_ADMIN']) @casino_required def lottery_end(v): success, message = end_lottery_session() @@ -16,7 +16,7 @@ def lottery_end(v): @app.post("/lottery/start") -@admin_level_required(3) +@admin_level_required(PERMS['LOTTERY_ADMIN']) @casino_required def lottery_start(v): start_new_lottery_session() @@ -51,7 +51,7 @@ def lottery_active(v): return {"message": "", "stats": {"user": v.lottery_stats, "lottery": lottery, "participants": participants}} @app.get("/admin/lottery/participants") -@admin_level_required(2) +@admin_level_required(PERMS['LOTTERY_VIEW_PARTICIPANTS']) @casino_required def lottery_admin(v): participants = get_users_participating_in_lottery()