diff --git a/files/helpers/const.py b/files/helpers/const.py index 2bc08d33c..750ee0e23 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -137,6 +137,7 @@ PERMS = { # Minimum admin_level to perform action. 'USER_AGENDAPOSTER': 2, 'USER_CLUB_ALLOW_BAN': 2, 'USER_LINK': 2, + 'USER_TITLE_CHANGE': 2, 'POST_TO_CHANGELOG': 1, 'POST_TO_POLL_THREAD': 2, 'POST_BETS': 3, diff --git a/files/routes/admin.py b/files/routes/admin.py index cdca52e8a..cc7123122 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -954,7 +954,7 @@ def unshadowban(user_id, v): @app.post("/admin/title_change/") @limiter.limit("1/second;30/minute;200/hour;1000/day") -@admin_level_required(2) +@admin_level_required(PERMS['USER_TITLE_CHANGE']) def admin_title_change(user_id, v): user = get_account(user_id) diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 1f7c161d9..51a817f1f 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -273,6 +273,7 @@ {% if v and v.id != u.id and v.admin_level > 1 %}

+ {% if v.admin_level >= PERMS['USER_TITLE_CHANGE'] %}
@@ -290,7 +291,7 @@
- + {% endif %}

 						

@@ -646,9 +647,8 @@
 
 						

- + {% if v.admin_level >= PERMS['USER_TITLE_CHANGE'] %}
-
@@ -664,7 +664,7 @@
- + {% endif %}