lottery permissions

master
justcool393 2022-10-05 20:09:20 -07:00
parent f5996afc5a
commit d709334180
2 changed files with 5 additions and 3 deletions

View File

@ -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 = {

View File

@ -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()