Merge branch 'apple'
This commit is contained in:
commit
0e566e4c97
@ -96,6 +96,10 @@ def authorized(user, collection, right):
|
|||||||
|
|
||||||
If the user is empty it checks for anonymous rights
|
If the user is empty it checks for anonymous rights
|
||||||
"""
|
"""
|
||||||
|
collection_url = collection.url.rstrip("/") or "/"
|
||||||
|
if collection_url in (".well-known/carddav", ".well-known/caldav"):
|
||||||
|
return right == "r"
|
||||||
rights_type = config.get("rights", "type").lower()
|
rights_type = config.get("rights", "type").lower()
|
||||||
return rights_type == "none" or (_read_from_sections(
|
return (
|
||||||
user or "", collection.url.rstrip("/") or "/", right))
|
rights_type == "none" or
|
||||||
|
_read_from_sections(user or "", collection_url, right))
|
||||||
|
@ -296,7 +296,10 @@ def _propfind_response(path, item, props, user):
|
|||||||
# pylint: enable=W0511
|
# pylint: enable=W0511
|
||||||
elif tag == _tag("D", "current-user-principal") and user:
|
elif tag == _tag("D", "current-user-principal") and user:
|
||||||
tag = ET.Element(_tag("D", "href"))
|
tag = ET.Element(_tag("D", "href"))
|
||||||
tag.text = _href("/%s/" % user)
|
if item.resource_type == "addressbook":
|
||||||
|
tag.text = _href("/%s/addressbook.vcf/" % user)
|
||||||
|
else:
|
||||||
|
tag.text = _href("/%s/calendar.ics/" % user)
|
||||||
element.append(tag)
|
element.append(tag)
|
||||||
elif tag == _tag("D", "current-user-privilege-set"):
|
elif tag == _tag("D", "current-user-privilege-set"):
|
||||||
privilege = ET.Element(_tag("D", "privilege"))
|
privilege = ET.Element(_tag("D", "privilege"))
|
||||||
|
Loading…
Reference in New Issue
Block a user