separate nuking perm

master
Aevann 2024-08-09 14:29:55 +03:00
parent 804a75769b
commit 97a0779817
3 changed files with 6 additions and 3 deletions

View File

@ -168,6 +168,7 @@ if SITE_NAME == 'rDrama':
'PINNING_POSTS': 1,
'POST_COMMENT_MODERATION': 2,
'NUKE_USER': 2,
'ADMIN_HOME_VISIBLE': 2,
'REPORTS_REMOVE': 2,
'CHAT_MUTE': 2,
@ -261,6 +262,7 @@ else:
'WARN_ON_FAILED_LOGIN': 1,
'PINNING_COMMENTS': 1,
'NUKE_USER': 2,
'PINNING_POSTS': 2,
'POST_BETS': 2,
'POST_BETS_DISTRIBUTE': 2,

View File

@ -1724,7 +1724,7 @@ def unban_domain(v, domain):
@limiter.limit('1/second', scope=rpath, key_func=get_ID)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
@admin_level_required(PERMS['POST_COMMENT_MODERATION'])
@admin_level_required(PERMS['NUKE_USER'])
def admin_nuke_user(v):
user = get_user(request.values.get("user"))
@ -1760,7 +1760,7 @@ def admin_nuke_user(v):
@limiter.limit('1/second', scope=rpath, key_func=get_ID)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
@admin_level_required(PERMS['POST_COMMENT_MODERATION'])
@admin_level_required(PERMS['NUKE_USER'])
def admin_nunuke_user(v):
user = get_user(request.values.get("user"))

View File

@ -107,7 +107,8 @@
<button type="button" id="mute-user-{{deviceType}}" class="{% if u.is_muted %}d-none{% endif %} btn btn-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/mute_user/{{u.id}}','mute-user-{{deviceType}}','unmute-user-{{deviceType}}','d-none')">Mute</button>
<button type="button" id="unmute-user-{{deviceType}}" class="mb-1 {% if not u.is_muted %}d-none{% endif %} btn btn-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unmute_user/{{u.id}}','mute-user-{{deviceType}}','unmute-user-{{deviceType}}','d-none')">Unmute</button>
{% endif %}
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
{% if v.admin_level >= PERMS['NUKE_USER'] %}
<form action="/admin/unnuke_user" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHR(this)">
<input hidden name="formkey", value="{{v|formkey}}" class="notranslate" translate="no">
<input hidden name="user" value="{{u.username}}">