From f9ce1d0e6d17d40c24a94c116c07ad0b3e3cb278 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Wed, 5 Feb 2014 14:11:40 +0100 Subject: [PATCH] Remove the backend/type split for rights in configuration --- config | 4 ---- radicale/config.py | 1 - radicale/rights/__init__.py | 9 ++++----- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/config b/config index c545b86..ace677b 100644 --- a/config +++ b/config @@ -104,10 +104,6 @@ committer = Radicale [rights] # Rights backend -# Value: regex | custom -backend = regex - -# Rights management method # Value: None | owner_only | owner_write | from_file | custom type = None diff --git a/radicale/config.py b/radicale/config.py index eecd42c..f6ac6f0 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -76,7 +76,6 @@ INITIAL_CONFIG = { "git": { "committer": "Radicale "}, "rights": { - "backend": "regex", "type": "None", "custom_handler": "", "file": "~/.config/radicale/rights"}, diff --git a/radicale/rights/__init__.py b/radicale/rights/__init__.py index 789953b..2fa6cd6 100644 --- a/radicale/rights/__init__.py +++ b/radicale/rights/__init__.py @@ -30,15 +30,14 @@ from .. import config def load(): """Load list of available storage managers.""" - storage_type = config.get("rights", "backend") - if storage_type == 'custom': + storage_type = config.get("rights", "type") + if storage_type == "custom": rights_module = config.get("rights", "custom_handler") __import__(rights_module) module = sys.modules[rights_module] else: - root_module = __import__( - "rights.%s" % storage_type, globals=globals(), level=2) - module = getattr(root_module, storage_type) + root_module = __import__("rights.regex", globals=globals(), level=2) + module = root_module.regex sys.modules[__name__].authorized = module.authorized return module