add post bypass checking perm

master
justcool393 2022-10-20 17:51:29 -05:00
parent c78579ec5a
commit 360cff7e8f
2 changed files with 2 additions and 1 deletions

View File

@ -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,

View File

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