Skip to content

Commit 58244e4

Browse files
committed
file-based rights: get permissions before using them
1 parent 2ecaf69 commit 58244e4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

radicale/rights/from_file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def authorization(self, user: str, path: str) -> str:
116116
"%s" % (section, self._filename, e)) from e
117117
# evaluate permissions
118118
if collection_match:
119+
permission = self._rights_config.get(section, "permissions")
119120
if user_match and group_match:
120121
logger.debug("Rule %r:%r:%r matches %r:%r:%r from section %r permission %r",
121122
user, group, sane_path, user_pattern, group_pattern,
@@ -128,7 +129,6 @@ def authorization(self, user: str, path: str) -> str:
128129
logger.debug("Rule %r:%r matches %r:%r from section %r permission %r",
129130
group, sane_path, group_pattern,
130131
collection_pattern, section, permission)
131-
permission = self._rights_config.get(section, "permissions")
132132
return permission
133133
if self._log_rights_rule_doesnt_match_on_debug:
134134
logger.debug("Rule %r:%r doesn't match %r:%r from section %r",

0 commit comments

Comments
 (0)