mirror of
https://github.com/Kozea/Radicale.git
synced 2025-04-03 21:27:36 +03:00
add new option rights/permit_overwrite_collection
This commit is contained in:
parent
bfe0ccc463
commit
973b26b2e9
4 changed files with 10 additions and 0 deletions
2
config
2
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]
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue