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/>.
|
||||
|
||||
import errno
|
||||
import logging
|
||||
import re
|
||||
import socket
|
||||
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)
|
||||
if share and share_overlay:
|
||||
# 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:
|
||||
all_props_with_remove = cast(Dict[str, Optional[str]], radicale_item.check_and_sanitize_props(share['Properties']))
|
||||
else:
|
||||
all_props_with_remove = {}
|
||||
all_props_with_remove.update(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:
|
||||
if collection is not None:
|
||||
# always the case, but makes mypy happy
|
||||
@@ -115,11 +114,10 @@ class ApplicationPartProppatch(ApplicationBase):
|
||||
access = Access(self._rights, user, path, permissions_filter)
|
||||
raw_permissions = self._rights.authorization(user, path)
|
||||
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:
|
||||
# priority share->rights->global
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
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)
|
||||
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)
|
||||
if ("P" 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'])
|
||||
@@ -140,10 +138,10 @@ class ApplicationPartProppatch(ApplicationBase):
|
||||
else:
|
||||
return httputils.NOT_ALLOWED
|
||||
else:
|
||||
logger.debug("TRACE/PROPPATCH/xml_proppatch: write-access: %r", path)
|
||||
logger.trace("PROPPATCH/xml_proppatch: write-access: %r", path)
|
||||
if share:
|
||||
# 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 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)
|
||||
|
||||
Reference in New Issue
Block a user