From 3dc22837184a33ff874eea79f9dab14ed7bdbb26 Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Tue, 18 Jul 2023 19:41:22 +0000 Subject: [PATCH] allow setting permission_rules to null to forbid everything --- src/Content/ContentManager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index 350370d0a..bcf96c0b7 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -514,6 +514,11 @@ def getUserContentRules(self, parent_content, inner_path, content): for permission_pattern, permission_rules in list(user_contents["permission_rules"].items()): # Regexp rules if not SafeRe.match(permission_pattern, user_urn): continue # Rule is not valid for user + if permission_rules is None: + self.log.info(f'Permission rule for {permission_pattern} is null, ' + 'we set max_size[_optional] to zero. ' + 'NOTE: This is not supported by <0.7.10') + permission_rules = {'max_size': 0, 'max_size_optional': 0} # Update rules if its better than current recorded ones for key, val in permission_rules.items(): if key not in rules: