From 04e3b168a604d6e327b11a8310e4f1b8f38d1279 Mon Sep 17 00:00:00 2001 From: changchiyou Date: Wed, 13 Mar 2024 23:17:22 +0800 Subject: [PATCH] config: allow custom default user permissions - chat deletion Allow Chat Deletion --- backend/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/config.py b/backend/config.py index 831371bb7..281aea2a4 100644 --- a/backend/config.py +++ b/backend/config.py @@ -288,7 +288,9 @@ DEFAULT_PROMPT_SUGGESTIONS = ( DEFAULT_USER_ROLE = os.getenv("DEFAULT_USER_ROLE", "pending") -USER_PERMISSIONS = {"chat": {"deletion": True}} + +USER_PERMISSIONS_CHAT_DELETION = os.getenv('USER_PERMISSIONS_CHAT_DELETION', 'True') == 'True' +USER_PERMISSIONS = {"chat": {"deletion": USER_PERMISSIONS_CHAT_DELETION}} MODEL_FILTER_ENABLED = os.environ.get("MODEL_FILTER_ENABLED", False)