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:
parent
107fe1bc53
commit
e852c887d7
5 changed files with 16 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue