mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-10 18:40:53 +00:00
Fixed authentication for anonymous users
This commit is contained in:
parent
43785e48a9
commit
58faf725b0
2 changed files with 13 additions and 3 deletions
|
@ -93,5 +93,7 @@ def _read_from_sections(user, collection, permission):
|
|||
def authorized(user, collection, right):
|
||||
"""Check if the user is allowed to read or write the collection."""
|
||||
rights_type = config.get("rights", "type").lower()
|
||||
return rights_type == "none" or (user and _read_from_sections(
|
||||
user, collection.url.rstrip("/") or "/", right))
|
||||
return rights_type == "none" or (
|
||||
(True if not user else user) and _read_from_sections(
|
||||
user if user else "", collection.url.rstrip("/") or "/", right)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue