From ea8eda35a7bd831964c38b38cc9a5b19bcb44d6a Mon Sep 17 00:00:00 2001 From: 0livd <0livd@users.noreply.github.com> Date: Thu, 18 May 2017 10:48:09 +0100 Subject: Public project creation and admin permissions (#210) * Add a @requires_admin decorator It can be used to protect specific endpoints with ADMIN_PASSWORD (a password that is stored unencrypted in the settings) The decorator has no effect if ADMIN_PASSWORD is an empty string (default value) * Require admin permissions to access create project endpoint When ADMIN_PASSWORD is not empty, project creation form on the home page will be replaced by a link to the create project endpoint so one is able to enter the admin password before filling the form --- budget/default_settings.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'budget/default_settings.py') diff --git a/budget/default_settings.py b/budget/default_settings.py index 210b3f2..15fe9cd 100644 --- a/budget/default_settings.py +++ b/budget/default_settings.py @@ -10,3 +10,5 @@ SECRET_KEY = "tralala" MAIL_DEFAULT_SENDER = ("Budget manager", "budget@notmyidea.org") ACTIVATE_DEMO_PROJECT = True + +ADMIN_PASSWORD = "" -- cgit v1.1