From 65c75ba5daacfe4b58cf58ebc630791c4f8d8154 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 5 Oct 2022 20:47:42 -0700 Subject: [PATCH] club permissions --- files/helpers/const.py | 2 ++ files/routes/admin.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index a91983c84..df197845a 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -133,6 +133,7 @@ PERMS = { # Minimum admin_level to perform action. 'USER_BAN': 2, 'USER_SHADOWBAN': 2, 'USER_AGENDAPOSTER': 2, + 'USER_CLUB_ALLOW_BAN': 2, 'POST_TO_CHANGELOG': 1, 'BYPASS_PIN_LIMIT': 3, 'VIEW_PENDING_SUBMITTED_MARSEYS': 3, @@ -240,6 +241,7 @@ GIFT_NOTIF_ID = 5 if SITE == 'rdrama.net': FEATURES['PRONOUNS'] = True FEATURES['HOUSES'] = True + PERMS['ADMIN_ADD_PERM_LEVEL'] = 0 # extra check here to disallow adding admins on site SIDEBAR_THREAD = 37696 BANNER_THREAD = 37697 diff --git a/files/routes/admin.py b/files/routes/admin.py index 74dc8f458..2ccdee9d0 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -299,7 +299,7 @@ def revert_actions(v, username): @app.post("/@/club_allow") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@admin_level_required(2) +@admin_level_required(PERMS['USER_CLUB_ALLOW_BAN']) def club_allow(v, username): u = get_user(username, v=v) @@ -323,7 +323,7 @@ def club_allow(v, username): @app.post("/@/club_ban") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@admin_level_required(2) +@admin_level_required(PERMS['USER_CLUB_ALLOW_BAN']) def club_ban(v, username): u = get_user(username, v=v)