mirror of
https://github.com/Kozea/Radicale.git
synced 2025-07-23 17:48:30 +00:00
Find collections if necessary
This commit is contained in:
parent
90d82d044c
commit
3aa992e518
1 changed files with 8 additions and 6 deletions
|
@ -264,9 +264,6 @@ class Application(object):
|
||||||
|
|
||||||
path = environ["PATH_INFO"]
|
path = environ["PATH_INFO"]
|
||||||
|
|
||||||
# Find collection(s)
|
|
||||||
items = ical.Collection.from_path(path, environ.get("HTTP_DEPTH", "0"))
|
|
||||||
|
|
||||||
# Get function corresponding to method
|
# Get function corresponding to method
|
||||||
function = getattr(self, environ["REQUEST_METHOD"].lower())
|
function = getattr(self, environ["REQUEST_METHOD"].lower())
|
||||||
|
|
||||||
|
@ -280,12 +277,17 @@ class Application(object):
|
||||||
else:
|
else:
|
||||||
user = password = None
|
user = password = None
|
||||||
|
|
||||||
read_allowed_items, write_allowed_items = \
|
|
||||||
self.collect_allowed_items(items, user)
|
|
||||||
|
|
||||||
is_authenticated = auth.is_authenticated(user, password)
|
is_authenticated = auth.is_authenticated(user, password)
|
||||||
is_valid_user = is_authenticated or not user
|
is_valid_user = is_authenticated or not user
|
||||||
|
|
||||||
|
if is_valid_user:
|
||||||
|
items = ical.Collection.from_path(path,
|
||||||
|
environ.get("HTTP_DEPTH", "0"))
|
||||||
|
read_allowed_items, write_allowed_items = \
|
||||||
|
self.collect_allowed_items(items, user)
|
||||||
|
else:
|
||||||
|
read_allowed_items, write_allowed_items = None, None
|
||||||
|
|
||||||
if is_valid_user and (
|
if is_valid_user and (
|
||||||
(read_allowed_items or write_allowed_items) or
|
(read_allowed_items or write_allowed_items) or
|
||||||
(is_authenticated and function == self.propfind) or
|
(is_authenticated and function == self.propfind) or
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue