diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index db299c130..1c39c5289 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -467,6 +467,7 @@ PERMS = { # Minimum admin_level to perform action. 'BUY_GHOST_AWARD': 2, 'LOTTERY_VIEW_PARTICIPANTS': 2, 'POST_COMMENT_INFINITE_PINGS': 2, + 'IGNORE_1WEEk_EDITING_LIMIT': 2, 'ADMIN_ADD': 3, 'ADMIN_REMOVE': 3, diff --git a/files/routes/comments.py b/files/routes/comments.py index 614b06773..de324b133 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -613,7 +613,8 @@ def toggle_comment_nsfw(cid, v): def edit_comment(cid, v): c = get_comment(cid, v=v) - if time.time() - c.created_utc > 7*24*60*60 and not (c.post and c.post.private): + if time.time() - c.created_utc > 7*24*60*60 and not (c.post and c.post.private) \ + and v.admin_level < PERMS["IGNORE_1WEEk_EDITING_LIMIT"]: abort(403, "You can't edit comments older than 1 week!") if c.author_id != v.id: abort(403) diff --git a/files/routes/posts.py b/files/routes/posts.py index 95706906c..a4c3f6ebf 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -970,8 +970,8 @@ def edit_post(pid, v): if not v.can_edit(p): abort(403) # Disable edits on things older than 1wk unless it's a draft or editor is a jannie - if (time.time() - p.created_utc > 7*24*60*60 and not p.private - and not v.admin_level >= PERMS['POST_EDITING']): + if time.time() - p.created_utc > 7*24*60*60 and not p.private \ + and v.admin_level < PERMS["IGNORE_1WEEk_EDITING_LIMIT"]: abort(403, "You can't edit posts older than 1 week!") title = sanitize_raw_title(request.values.get("title", ""))