Merge branch 'apple'

This commit is contained in:
Guillaume Ayoub
2013-12-24 11:22:57 +01:00
2 changed files with 10 additions and 3 deletions

View File

@ -96,6 +96,10 @@ def authorized(user, collection, right):
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()
return rights_type == "none" or (_read_from_sections(
user or "", collection.url.rstrip("/") or "/", right))
return (
rights_type == "none" or
_read_from_sections(user or "", collection_url, right))