1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-06-26 16:45:52 +00:00

Enhancement: add option to toggle debug log of right with doesn't match

This commit is contained in:
Peter Bieringer 2024-08-28 08:03:16 +02:00
parent 107fe1bc53
commit e852c887d7
5 changed files with 16 additions and 1 deletions

View file

@ -48,6 +48,7 @@ class Rights(rights.BaseRights):
def __init__(self, configuration: config.Configuration) -> None:
super().__init__(configuration)
self._filename = configuration.get("rights", "file")
self._log_right_doesnt_match = configuration.get("logging", "right_doesnt_match")
def authorization(self, user: str, path: str) -> str:
user = user or ""
@ -80,7 +81,8 @@ class Rights(rights.BaseRights):
user, sane_path, user_pattern,
collection_pattern, section, permission)
return permission
logger.debug("Rule %r:%r doesn't match %r:%r from section %r",
if self._log_right_doesnt_match:
logger.debug("Rule %r:%r doesn't match %r:%r from section %r",
user, sane_path, user_pattern, collection_pattern,
section)
logger.info("Rights: %r:%r doesn't match any section", user, sane_path)