disallow non-jannies from moving their posts to /h/changelog

pull/124/head
Aevann 2023-02-18 01:26:38 +02:00
parent d5d3e1f65e
commit 03bd9653ea
1 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,9 @@ def move_post(post:Submission, v:User, reason:str) -> Union[bool, str]:
if post.author.exiled_from(sub_to):
abort(403, f"User is exiled from this {HOLE_NAME}!")
if sub_to == 'changelog' and not v.admin_level >= PERMS['POST_TO_CHANGELOG']:
abort(403, "You don't have sufficient permissions to post in /h/changelog")
if sub_to in {'furry','vampire','racist','femboy'} and not v.client and not post.author.house.lower().startswith(sub_to):
if v.id == post.author_id:
abort(403, f"You need to be a member of House {sub_to.capitalize()} to post in /h/{sub_to}")