schema.py
changeset 5707 3586d36d2a45
parent 5558 afd1face1faf
parent 5703 24ca7615379b
child 5752 b0bb553e3be4
--- a/schema.py	Wed Jun 09 16:16:54 2010 +0200
+++ b/schema.py	Thu Jun 10 10:16:59 2010 +0200
@@ -852,11 +852,9 @@
             except KeyError:
                 pass
         rql, has_perm_defs, keyarg = self.transform_has_permission()
-        if creating:
-            # when creating an entity, consider has_*_permission satisfied
-            if has_perm_defs:
-                return True
-            return False
+        # when creating an entity, expression related to X satisfied
+        if creating and 'X' in self.rqlst.defined_vars:
+            return True
         if keyarg is None:
             kwargs.setdefault('u', session.user.eid)
             try: