mirror of
https://github.com/Kozea/Radicale.git
synced 2025-06-26 16:45:52 +00:00
Fixed partially anonymous authentication
This commit is contained in:
parent
58faf725b0
commit
e2512b12fb
2 changed files with 19 additions and 27 deletions
|
@ -91,9 +91,10 @@ def _read_from_sections(user, collection, permission):
|
|||
|
||||
|
||||
def authorized(user, collection, right):
|
||||
"""Check if the user is allowed to read or write the collection."""
|
||||
"""Check if the user is allowed to read or write the collection.
|
||||
|
||||
If the user is empty it checks for anonymous rights
|
||||
"""
|
||||
rights_type = config.get("rights", "type").lower()
|
||||
return rights_type == "none" or (
|
||||
(True if not user else user) and _read_from_sections(
|
||||
user if user else "", collection.url.rstrip("/") or "/", right)
|
||||
)
|
||||
return rights_type == "none" or (_read_from_sections(
|
||||
user or "", collection.url.rstrip("/") or "/", right))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue