diff --git a/config b/config index 5fb11290..3704f65b 100644 --- a/config +++ b/config @@ -115,6 +115,8 @@ # Permit delete of a collection (global) #permit_delete_collection = True +# Permit overwrite of a collection (global) +#permit_overwrite_collection = False [storage] diff --git a/radicale/app/__init__.py b/radicale/app/__init__.py index ee958ad4..4f11ad3f 100644 --- a/radicale/app/__init__.py +++ b/radicale/app/__init__.py @@ -70,6 +70,7 @@ class Application(ApplicationPartDelete, ApplicationPartHead, _auth_realm: str _extra_headers: Mapping[str, str] _permit_delete_collection: bool + _permit_overwrite_collection: bool def __init__(self, configuration: config.Configuration) -> None: """Initialize Application. @@ -91,6 +92,8 @@ class Application(ApplicationPartDelete, ApplicationPartHead, self._auth_realm = configuration.get("auth", "realm") self._permit_delete_collection = configuration.get("rights", "permit_delete_collection") logger.info("permit delete of collection: %s", self._permit_delete_collection) + self._permit_overwrite_collection = configuration.get("rights", "permit_overwrite_collection") + logger.info("permit overwrite of collection: %s", self._permit_overwrite_collection) self._extra_headers = dict() for key in self.configuration.options("headers"): self._extra_headers[key] = configuration.get("headers", key) diff --git a/radicale/app/base.py b/radicale/app/base.py index 71fd8073..2132111d 100644 --- a/radicale/app/base.py +++ b/radicale/app/base.py @@ -40,6 +40,7 @@ class ApplicationBase: _web: web.BaseWeb _encoding: str _permit_delete_collection: bool + _permit_overwrite_collection: bool _hook: hook.BaseHook def __init__(self, configuration: config.Configuration) -> None: diff --git a/radicale/config.py b/radicale/config.py index 5bddaf91..27c48760 100644 --- a/radicale/config.py +++ b/radicale/config.py @@ -245,6 +245,10 @@ DEFAULT_CONFIG_SCHEMA: types.CONFIG_SCHEMA = OrderedDict([ "value": "True", "help": "permit delete of a collection", "type": bool}), + ("permit_overwrite_collection", { + "value": "False", + "help": "permit overwrite of a collection", + "type": bool}), ("file", { "value": "/etc/radicale/rights", "help": "file for rights management from_file",