proppatch/log: replace legacy trace log
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
|
# along with Radicale. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import logging
|
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
@@ -65,14 +64,14 @@ def xml_proppatch(base_prefix: str, path: str,
|
|||||||
props_with_remove = xmlutils.props_from_request(xml_request)
|
props_with_remove = xmlutils.props_from_request(xml_request)
|
||||||
if share and share_overlay:
|
if share and share_overlay:
|
||||||
# PROPPATCH overlay adjustment
|
# PROPPATCH overlay adjustment
|
||||||
logger.debug("TRACE/PROPPATCH/xml_proppatch: share+share_overlay is active: %r", share)
|
logger.trace("PROPPATCH/xml_proppatch: share+share_overlay is active: %r", share)
|
||||||
if share['Properties'] is not None:
|
if share['Properties'] is not None:
|
||||||
all_props_with_remove = cast(Dict[str, Optional[str]], radicale_item.check_and_sanitize_props(share['Properties']))
|
all_props_with_remove = cast(Dict[str, Optional[str]], radicale_item.check_and_sanitize_props(share['Properties']))
|
||||||
else:
|
else:
|
||||||
all_props_with_remove = {}
|
all_props_with_remove = {}
|
||||||
all_props_with_remove.update(props_with_remove)
|
all_props_with_remove.update(props_with_remove)
|
||||||
all_props = radicale_item.check_and_sanitize_props(all_props_with_remove)
|
all_props = radicale_item.check_and_sanitize_props(all_props_with_remove)
|
||||||
logger.debug("TRACE/PROPPATCH/xml_proppatch: share+share_overlay result: %r", all_props)
|
logger.trace("PROPPATCH/xml_proppatch: share+share_overlay result: %r", all_props)
|
||||||
else:
|
else:
|
||||||
if collection is not None:
|
if collection is not None:
|
||||||
# always the case, but makes mypy happy
|
# always the case, but makes mypy happy
|
||||||
@@ -115,11 +114,10 @@ class ApplicationPartProppatch(ApplicationBase):
|
|||||||
access = Access(self._rights, user, path, permissions_filter)
|
access = Access(self._rights, user, path, permissions_filter)
|
||||||
raw_permissions = self._rights.authorization(user, path)
|
raw_permissions = self._rights.authorization(user, path)
|
||||||
if not access.check("w"):
|
if not access.check("w"):
|
||||||
logger.debug("TRACE/PROPPATCH/xml_proppatch: no native write-access: %r", path)
|
logger.trace("PROPPATCH/xml_proppatch: no native write-access: %r", path)
|
||||||
if share:
|
if share:
|
||||||
# priority share->rights->global
|
# priority share->rights->global
|
||||||
if logger.isEnabledFor(logging.DEBUG):
|
logger.trace("PROPPATCH/share: raw_permissions=%r share[Permissions]=%r permit_properties_overlay=%s enforce_properties_overlay=%s", raw_permissions, share['Permissions'], self._sharing.permit_properties_overlay, self._sharing.enforce_properties_overlay)
|
||||||
logger.debug("TRACE/PROPPATCH/share: raw_permissions=%r share[Permissions]=%r permit_properties_overlay=%s enforce_properties_overlay=%s", raw_permissions, share['Permissions'], self._sharing.permit_properties_overlay, self._sharing.enforce_properties_overlay)
|
|
||||||
if ("P" in share['Permissions'] or
|
if ("P" in share['Permissions'] or
|
||||||
("P" in raw_permissions and "p" not in share['Permissions']) or
|
("P" in raw_permissions and "p" not in share['Permissions']) or
|
||||||
(self._sharing.permit_properties_overlay and "p" not in raw_permissions and "p" not in share['Permissions'])
|
(self._sharing.permit_properties_overlay and "p" not in raw_permissions and "p" not in share['Permissions'])
|
||||||
@@ -140,10 +138,10 @@ class ApplicationPartProppatch(ApplicationBase):
|
|||||||
else:
|
else:
|
||||||
return httputils.NOT_ALLOWED
|
return httputils.NOT_ALLOWED
|
||||||
else:
|
else:
|
||||||
logger.debug("TRACE/PROPPATCH/xml_proppatch: write-access: %r", path)
|
logger.trace("PROPPATCH/xml_proppatch: write-access: %r", path)
|
||||||
if share:
|
if share:
|
||||||
# write access -> check for enforced properties overlay
|
# write access -> check for enforced properties overlay
|
||||||
logger.debug("TRACE/PROPPATCH/xml_proppatch: write-access/sharing: %r", path_orig)
|
logger.trace("PROPPATCH/xml_proppatch: write-access/sharing: %r", path_orig)
|
||||||
if self._sharing.enforce_properties_overlay:
|
if self._sharing.enforce_properties_overlay:
|
||||||
if permissions_filter is not None and "e" in permissions_filter:
|
if permissions_filter is not None and "e" in permissions_filter:
|
||||||
logger.info("PROPPATCH request on shared %r: write-permissions, overlay enforced, but disabled by share permission 'e'", path_orig)
|
logger.info("PROPPATCH request on shared %r: write-permissions, overlay enforced, but disabled by share permission 'e'", path_orig)
|
||||||
|
|||||||
Reference in New Issue
Block a user