changeset 1547:e74f46dbe7c8

allow empty #acl for use case if you don't want default acl to get applied, but you also don't want to give any rights
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 14 Sep 2006 15:42:23 +0200
parents 27093deecd9f
children 2eb5117aa7de
files MoinMoin/security/__init__.py docs/CHANGES
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/security/__init__.py	Thu Sep 14 15:32:19 2006 +0200
+++ b/MoinMoin/security/__init__.py	Thu Sep 14 15:42:23 2006 +0200
@@ -224,7 +224,10 @@
         """
         is_group_member = request.dicts.has_member
 
-        acl_page = self.acl or request.cfg._acl_rights_default.acl
+        if self.acl is None: # no #acl used on Page
+            acl_page = request.cfg._acl_rights_default.acl
+        else: # we have a #acl on the page (self.acl can be [] if #acl is empty!)
+            acl_page = self.acl
         acl = request.cfg._acl_rights_before.acl + acl_page + request.cfg._acl_rights_after.acl
         allowed = None
         for entry, rightsdict in acl:
--- a/docs/CHANGES	Thu Sep 14 15:32:19 2006 +0200
+++ b/docs/CHANGES	Thu Sep 14 15:42:23 2006 +0200
@@ -218,6 +218,10 @@
     * Syncronisation of wikis using the SyncPages action
     * GetText2 macro that allows to translate messages that contain data
     * showtags action that lists all tags related to a page
+    * if you have "#acl" (without the quotes) on a page, this means now:
+      "this page has own (empty) ACLs, so do not use acl_rights_default here"
+      Please note that this is COMPLETELY DIFFERENT from having no ACL line at
+      all on the page (acl_rights_default is used in that case).
 
 
   Bugfixes: