From 01138ab592b46adaa04170ec3fd2e79234f4c1e2 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Tue, 11 Oct 2022 00:54:02 -0700 Subject: [PATCH] bypass read only mode perm --- files/helpers/const.py | 1 + files/helpers/wrappers.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 5453b28ce..41597212c 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -217,6 +217,7 @@ PERMS = { # Minimum admin_level to perform action. 'VIEW_PATRONS': 3, # note: extra check for Aevann, carp, or snakes 'VIEW_VOTE_BUTTONS_ON_USER_PAGE': 2, 'PRINT_MARSEYBUX_FOR_KIPPY_ON_PCMEMES': 3, # note: explicitly disabled on rDrama + 'SITE_BYPASS_READ_ONLY_MODE': 1, 'SITE_SETTINGS': 3, 'SITE_SETTINGS_SIDEBARS_BANNERS_BADGES': 3, 'SITE_SETTINGS_SNAPPY_QUOTES': 3, diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index c49c367b4..859dad106 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -42,7 +42,7 @@ def get_logged_in_user(): v.client = None - if request.method.lower() != "get" and app.config['SETTINGS']['Read-only mode'] and not (v and v.admin_level): + if request.method.lower() != "get" and app.config['SETTINGS']['Read-only mode'] and not (v and v.admin_level >= PERMS['SITE_BYPASS_READ_ONLY_MODE']): abort(403)