diff --git a/files/helpers/const.py b/files/helpers/const.py index 9b9ceb8aa..d29b4e925 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -169,6 +169,7 @@ PERMS = { # Minimum admin_level to perform action. 'ADMIN_ADD_PERM_LEVEL': 2, # permission level given when user added via site 'ADMIN_ACTIONS_REVERT': 3, 'ADMIN_MOP_VISIBLE': 2, + 'ADMIN_HOME_VISIBLE': 2, 'SITE_SETTINGS': 3, 'SITE_SETTINGS_SIDEBARS_BANNERS_BADGES': 3, 'SITE_SETTINGS_SNAPPY_QUOTES': 3, diff --git a/files/routes/admin.py b/files/routes/admin.py index cc7123122..642394a71 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -418,7 +418,7 @@ def reported_comments(v): standalone=True) @app.get("/admin") -@admin_level_required(2) +@admin_level_required(PERMS['ADMIN_HOME_VISIBLE']) def admin_home(v): under_attack = False diff --git a/files/routes/chat.py b/files/routes/chat.py index 9b2085366..56a53b4d6 100644 --- a/files/routes/chat.py +++ b/files/routes/chat.py @@ -97,7 +97,7 @@ def speak(data, v): total += 1 - if v.admin_level > 1: + if v.admin_level >= PERMS['USER_BAN']: text = text.lower() for i in mute_regex.finditer(text): username = i.group(1).lower()