diff --git a/files/helpers/const.py b/files/helpers/const.py index db5d856d7..ba4f6dac8 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -176,8 +176,8 @@ PERMS = { # Minimum admin_level to perform action. 'SITE_SETTINGS_SIDEBARS_BANNERS_BADGES': 3, 'SITE_SETTINGS_SNAPPY_QUOTES': 3, 'SITE_SETTINGS_UNDER_ATTACK': 3, - 'CACHE_PURGE_CDN': 3, - 'CACHE_DUMP_INTERNAL': 2, + 'SITE_CACHE_PURGE_CDN': 3, + 'SITE_CACHE_DUMP_INTERNAL': 2, 'DOMAINS_BAN': 3, 'NOTIFICATIONS_HOLE_INACTIVITY_DELETION': 2, 'NOTIFICATIONS_HOLE_CREATION': 2, diff --git a/files/routes/admin.py b/files/routes/admin.py index 385476cfc..346b32ada 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -471,7 +471,7 @@ def change_settings(v, setting): @app.post("/admin/purge_cache") -@admin_level_required(PERMS['CACHE_PURGE_CDN']) +@admin_level_required(PERMS['SITE_CACHE_PURGE_CDN']) def purge_cache(v): online = cache.get(ONLINE_STR) cache.clear() @@ -1386,7 +1386,7 @@ def admin_distinguish_comment(c_id, v): else: return {"message": "Comment undistinguished!"} @app.get("/admin/dump_cache") -@admin_level_required(PERMS['CACHE_DUMP_INTERNAL']) +@admin_level_required(PERMS['SITE_CACHE_DUMP_INTERNAL']) def admin_dump_cache(v): online = cache.get(ONLINE_STR) cache.clear() diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index 340e44ab4..ed324624f 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -139,8 +139,9 @@ {% endif %} - - + {% if v.admin_level >= PERMS['SITE_CACHE_PURGE_CDN'] %} + + {% endif %}
{% if SITE_NAME == 'PCM' and v.admin_level >= PERMS['PRINT_MARSEYBUX_FOR_KIPPY_ON_PCMEMES'] %}