diff --git a/backend/config.py b/backend/config.py index 099f726ca..b5e7a5394 100644 --- a/backend/config.py +++ b/backend/config.py @@ -290,7 +290,12 @@ DEFAULT_PROMPT_SUGGESTIONS = ( DEFAULT_USER_ROLE = os.getenv("DEFAULT_USER_ROLE", "pending") -USER_PERMISSIONS = {"chat": {"deletion": True}} + +USER_PERMISSIONS_CHAT_DELETION = ( + os.environ.get("USER_PERMISSIONS_CHAT_DELETION", "True").lower() == "true" +) + +USER_PERMISSIONS = {"chat": {"deletion": USER_PERMISSIONS_CHAT_DELETION}} MODEL_FILTER_ENABLED = os.environ.get("MODEL_FILTER_ENABLED", False) diff --git a/backend/constants.py b/backend/constants.py index 05bdebc54..994b8caf7 100644 --- a/backend/constants.py +++ b/backend/constants.py @@ -46,7 +46,7 @@ class ERROR_MESSAGES(str, Enum): PANDOC_NOT_INSTALLED = "Pandoc is not installed on the server. Please contact your administrator for assistance." INCORRECT_FORMAT = ( - lambda err="": f"Invalid format. Please use the correct format{err if err else ''}" + lambda err="": f"Invalid format. Please use the correct format{err}" ) RATE_LIMIT_EXCEEDED = "API rate limit exceeded"