disable adding admins on WPD

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-10-29 00:14:59 +02:00
parent 58912b124a
commit 649fc2414d
2 changed files with 4 additions and 3 deletions

View File

@ -159,7 +159,7 @@ LEADERBOARD_LIMIT = 25
################################################################################ ################################################################################
PERMS = { # Minimum admin_level to perform action. PERMS = { # Minimum admin_level to perform action.
'ADMIN_ADD': 3, # note: explicitly disabled on rDrama 'ADMIN_ADD': 3,
'ADMIN_REMOVE': 3, 'ADMIN_REMOVE': 3,
'ADMIN_ADD_PERM_LEVEL': 2, # permission level given when user added via site 'ADMIN_ADD_PERM_LEVEL': 2, # permission level given when user added via site
'ADMIN_ACTIONS_REVERT': 3, 'ADMIN_ACTIONS_REVERT': 3,
@ -403,7 +403,7 @@ ANTISPAM_BYPASS_IDS = ()
if SITE == 'rdrama.net': if SITE == 'rdrama.net':
FEATURES['PRONOUNS'] = True FEATURES['PRONOUNS'] = True
FEATURES['HOUSES'] = True FEATURES['HOUSES'] = True
PERMS['ADMIN_ADD_PERM_LEVEL'] = 0 # extra check here to disallow adding admins on site PERMS['ADMIN_ADD'] = 4
SIDEBAR_THREAD = 37696 SIDEBAR_THREAD = 37696
BANNER_THREAD = 37697 BANNER_THREAD = 37697
@ -486,6 +486,7 @@ elif SITE == 'watchpeopledie.tv':
PERMS['HOLE_CREATE'] = 2 PERMS['HOLE_CREATE'] = 2
PERMS['POST_EDITING'] = 2 PERMS['POST_EDITING'] = 2
PERMS['ADMIN_ADD'] = 4
SIDEBAR_THREAD = 5403 SIDEBAR_THREAD = 5403
BANNER_THREAD = 9869 BANNER_THREAD = 9869

View File

@ -22,7 +22,7 @@
{% macro userAdminToolsUpper(deviceType) %} {% macro userAdminToolsUpper(deviceType) %}
{% if v and v.id != u.id and v.admin_level >= PERMS['USER_MODERATION_TOOLS_VISIBLE'] %} {% if v and v.id != u.id and v.admin_level >= PERMS['USER_MODERATION_TOOLS_VISIBLE'] %}
{% if v.admin_level >= PERMS['ADMIN_ADD'] and SITE != 'rdrama.net' %} {% if v.admin_level >= PERMS['ADMIN_ADD'] %}
<a id="add-admin-{{deviceType}}" class="{% if u.admin_level >= PERMS['ADMIN_ADD_PERM_LEVEL'] %}d-none{% endif %} btn btn-primary" onclick="post_toast(this,'/@{{u.username}}/make_admin','add-admin-{{deviceType}}','remove-admin-{{deviceType}}','d-none')">Make admin</a> <a id="add-admin-{{deviceType}}" class="{% if u.admin_level >= PERMS['ADMIN_ADD_PERM_LEVEL'] %}d-none{% endif %} btn btn-primary" onclick="post_toast(this,'/@{{u.username}}/make_admin','add-admin-{{deviceType}}','remove-admin-{{deviceType}}','d-none')">Make admin</a>
{% endif %} {% endif %}
{% if v.admin_level >= PERMS['ADMIN_REMOVE'] %} {% if v.admin_level >= PERMS['ADMIN_REMOVE'] %}