From 360cff7e8f58ff8a16a4025dac693151ab0830e9 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Thu, 20 Oct 2022 17:51:29 -0500 Subject: [PATCH] add post bypass checking perm --- files/helpers/const.py | 1 + files/routes/posts.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 95b392fa1..2342781ab 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -170,6 +170,7 @@ PERMS = { # Minimum admin_level to perform action. 'POST_COMMENT_MODERATION': 2, 'POST_COMMENT_DISTINGUISH': 1, 'POST_COMMENT_MODERATION_TOOLS_VISIBLE': 2, # note: does not affect API at all + 'POST_BYPASS_REPOST_CHECKING': 1, 'POST_EDITING': 3, 'USER_BADGES': 2, 'USER_BAN': 2, diff --git a/files/routes/posts.py b/files/routes/posts.py index 88e44b2c8..85f724ff7 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -785,7 +785,7 @@ def submit_post(v, sub=None): Submission.deleted_utc == 0, Submission.is_banned == False ).first() - if repost and FEATURES['REPOST_DETECTION'] and not v.admin_level: + if repost and FEATURES['REPOST_DETECTION'] and not v.admin_level >= PERMS['POST_BYPASS_REPOST_CHECKING']: return redirect(repost.permalink) domain_obj = get_domain(domain)