server/test/data/schema.py
changeset 9984 793377697c81
parent 9832 17abdb7af3e6
parent 9981 7099bbd685aa
child 10114 6f4b4567b77d
--- a/server/test/data/schema.py	Fri Sep 12 09:49:01 2014 +0200
+++ b/server/test/data/schema.py	Wed Sep 24 18:04:30 2014 +0200
@@ -1,4 +1,4 @@
-# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -92,6 +92,7 @@
     type = String(maxsize=6)
     para = String(maxsize=512,
                   __permissions__ = {
+                      'add': ('managers', ERQLExpression('X in_state S, S name "todo"')),
                       'read':   ('managers', 'users', 'guests'),
                       'update': ('managers', ERQLExpression('X in_state S, S name "todo"')),
                       })
@@ -109,6 +110,23 @@
                                                                'S,Y')])
     todo_by = SubjectRelation('CWUser')
 
+
+class Frozable(EntityType):
+    __permissions__ = {
+        'read':   ('managers', 'users'),
+        'add':    ('managers', 'users'),
+        'update': ('managers', ERQLExpression('X frozen False'),),
+        'delete': ('managers', ERQLExpression('X frozen False'),)
+    }
+    name = String()
+    frozen = Boolean(default=False,
+                     __permissions__ = {
+                         'read':   ('managers', 'users'),
+                         'add':    ('managers', 'users'),
+                         'update': ('managers', 'owners')
+                         })
+
+
 class Personne(EntityType):
     __unique_together__ = [('nom', 'prenom', 'inline2')]
     nom    = String(fulltextindexed=True, required=True, maxsize=64)