Fix naming
This commit is contained in:
parent
fdc595693c
commit
ed128ebb48
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import itertools
|
import itertools
|
||||||
|
import os
|
||||||
import posixpath
|
import posixpath
|
||||||
import socket
|
import socket
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
|
|
@ -355,7 +356,8 @@ class ApplicationPartPropfind(ApplicationBase):
|
||||||
permission = ""
|
permission = ""
|
||||||
status = "NO"
|
status = "NO"
|
||||||
if isinstance(item, storage.BaseCollection) \
|
if isinstance(item, storage.BaseCollection) \
|
||||||
and ((item.path.startswith("touchin") and item.get_meta("D:displayname") == "touchin") or item.path == "touchin"):
|
and ((item.path.startswith("default") and item.get_meta("D:displayname") == os.getcwd("ADDRESS_BOOK_NAME"))
|
||||||
|
or item.path == "default"):
|
||||||
permission = "r"
|
permission = "r"
|
||||||
status = "read"
|
status = "read"
|
||||||
logger.debug(
|
logger.debug(
|
||||||
|
|
@ -367,9 +369,9 @@ class ApplicationPartPropfind(ApplicationBase):
|
||||||
def do_PROPFIND(self, environ: types.WSGIEnviron, base_prefix: str,
|
def do_PROPFIND(self, environ: types.WSGIEnviron, base_prefix: str,
|
||||||
path: str, user: str) -> types.WSGIResponse:
|
path: str, user: str) -> types.WSGIResponse:
|
||||||
"""Manage PROPFIND request."""
|
"""Manage PROPFIND request."""
|
||||||
if path not in ("/", "", "/touchin/", "/touchin"):
|
if path not in ("/", "", "/default/", "/default"):
|
||||||
attributes = path.split("/")
|
attributes = path.split("/")
|
||||||
attributes[1] = "touchin"
|
attributes[1] = "default"
|
||||||
path = "/".join(attributes)
|
path = "/".join(attributes)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
@ -388,8 +390,6 @@ class ApplicationPartPropfind(ApplicationBase):
|
||||||
item = next(items_iter, None)
|
item = next(items_iter, None)
|
||||||
if not item:
|
if not item:
|
||||||
return httputils.NOT_FOUND
|
return httputils.NOT_FOUND
|
||||||
# if access and not access.check("r", item):
|
|
||||||
# return httputils.NOT_ALLOWED
|
|
||||||
# put item back
|
# put item back
|
||||||
items_iter = itertools.chain([item], items_iter)
|
items_iter = itertools.chain([item], items_iter)
|
||||||
allowed_items = self._collect_allowed_items(items_iter, user, environ.get("HTTP_DEPTH", "0"))
|
allowed_items = self._collect_allowed_items(items_iter, user, environ.get("HTTP_DEPTH", "0"))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue