sharing: extend DB with Conversion and Actions(reserved)
This commit is contained in:
@@ -31,7 +31,7 @@ from radicale.log import logger
|
||||
def propose_filename(collection: storage.BaseCollection, share: Union[dict, None] = None) -> str:
|
||||
"""Propose a filename for a collection."""
|
||||
share_bday_automap = False
|
||||
if share and share['ShareType'] == "bday":
|
||||
if share and share['Conversion'] == "bday":
|
||||
share_bday_automap = True
|
||||
if collection.tag == "VADDRESSBOOK" and not share_bday_automap:
|
||||
fallback_title = "Address book"
|
||||
@@ -112,7 +112,7 @@ class ApplicationPartGet(ApplicationBase):
|
||||
if not item.tag:
|
||||
return (httputils.NOT_ALLOWED if limited_access else
|
||||
httputils.DIRECTORY_LISTING)
|
||||
if share and share['ShareType'] == "bday":
|
||||
if share and share['Conversion'] == "bday":
|
||||
content_type = xmlutils.MIMETYPES["VCALENDAR"]
|
||||
else:
|
||||
content_type = xmlutils.MIMETYPES[item.tag]
|
||||
@@ -130,7 +130,7 @@ class ApplicationPartGet(ApplicationBase):
|
||||
"ETag": item.etag}
|
||||
if content_disposition:
|
||||
headers["Content-Disposition"] = content_disposition
|
||||
if isinstance(item, storage.BaseCollection) and self._sharing._enabled and share and share['ShareType'] == "bday":
|
||||
if isinstance(item, storage.BaseCollection) and share and share['Conversion'] == "bday":
|
||||
# convert VCF to ICS
|
||||
answer = item.serialize(vcf_to_ics=True)
|
||||
else:
|
||||
|
||||
@@ -124,7 +124,7 @@ def xml_propfind_response(
|
||||
break
|
||||
|
||||
share_bday_automap = False
|
||||
if share and share['ShareType'] == "bday":
|
||||
if share and share['Conversion'] == "bday":
|
||||
share_bday_automap = True
|
||||
|
||||
if share:
|
||||
@@ -546,7 +546,7 @@ class ApplicationPartPropfind(ApplicationBase):
|
||||
items_iter = itertools.chain([item], items_iter)
|
||||
for item, permission in list(self._collect_allowed_items(items_iter, user)):
|
||||
if self._sharing._enabled and share:
|
||||
if share['ShareType'] == "bday" and not isinstance(item, storage.BaseCollection):
|
||||
if share['Conversion'] == "bday" and not isinstance(item, storage.BaseCollection):
|
||||
if not item.convert_vcf_to_ics():
|
||||
continue
|
||||
allowed_items.append((item, permission, share['ShareType']))
|
||||
|
||||
Reference in New Issue
Block a user