Changed checks when inheriting permissions from parent
authorThierry Florac <thierry.florac@onf.fr>
Tue, 17 Mar 2015 16:02:49 +0100
changeset 24 7ed8fb9b132c
parent 23 3762a2d03432
child 25 31ad4c01e99e
Changed checks when inheriting permissions from parent
src/pyams_security/security.py
--- a/src/pyams_security/security.py	Wed Mar 11 12:14:35 2015 +0100
+++ b/src/pyams_security/security.py	Tue Mar 17 16:02:49 2015 +0100
@@ -54,7 +54,7 @@
         permission = self._everyone_permission
         if permission is None and self.inherit_parent_security:
             for parent in lineage(self):
-                if parent is self:
+                if parent in (self, self.__parent__):
                     continue
                 protection = IProtectedObject(parent, None)
                 if protection is not None:
@@ -72,7 +72,7 @@
         permission = self._authenticated_permission
         if permission is None and self.inherit_parent_security:
             for parent in lineage(self):
-                if parent is self:
+                if parent in (self, self.__parent__):
                     continue
                 protection = IProtectedObject(parent, None)
                 if protection is not None: