use ban permission for muting and also add a user home permission (wonder if should be the same as mop perm)

remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-10-05 22:54:48 -07:00
parent f2f954e0dd
commit 53a5343a55
3 changed files with 3 additions and 2 deletions

View File

@ -169,6 +169,7 @@ PERMS = { # Minimum admin_level to perform action.
'ADMIN_ADD_PERM_LEVEL': 2, # permission level given when user added via site
'ADMIN_ACTIONS_REVERT': 3,
'ADMIN_MOP_VISIBLE': 2,
'ADMIN_HOME_VISIBLE': 2,
'SITE_SETTINGS': 3,
'SITE_SETTINGS_SIDEBARS_BANNERS_BADGES': 3,
'SITE_SETTINGS_SNAPPY_QUOTES': 3,

View File

@ -418,7 +418,7 @@ def reported_comments(v):
standalone=True)
@app.get("/admin")
@admin_level_required(2)
@admin_level_required(PERMS['ADMIN_HOME_VISIBLE'])
def admin_home(v):
under_attack = False

View File

@ -97,7 +97,7 @@ def speak(data, v):
total += 1
if v.admin_level > 1:
if v.admin_level >= PERMS['USER_BAN']:
text = text.lower()
for i in mute_regex.finditer(text):
username = i.group(1).lower()