7 """ |
7 """ |
8 from yams.buildobjs import EntityType, RelationType, SubjectRelation |
8 from yams.buildobjs import EntityType, RelationType, SubjectRelation |
9 from cubicweb.schema import ERQLExpression |
9 from cubicweb.schema import ERQLExpression |
10 |
10 |
11 class ToTo(EntityType): |
11 class ToTo(EntityType): |
12 permissions = { |
12 __permissions__ = { |
13 'read': ('managers',), |
13 'read': ('managers',), |
14 'add': ('managers',), |
14 'add': ('managers',), |
15 'update': ('managers',), |
15 'update': ('managers',), |
16 'delete': ('managers',), |
16 'delete': ('managers',), |
17 } |
17 } |
18 toto = SubjectRelation('TuTu') |
18 toto = SubjectRelation('TuTu') |
19 |
19 |
20 class TuTu(EntityType): |
20 class TuTu(EntityType): |
21 permissions = { |
21 __permissions__ = { |
22 'read': ('managers',), |
22 'read': ('managers',), |
23 'add': ('managers',), |
23 'add': ('managers',), |
24 'update': ('managers',), |
24 'update': ('managers',), |
25 'delete': ('managers',), |
25 'delete': ('managers',), |
26 } |
26 } |
27 |
27 |
28 class toto(RelationType): |
28 class toto(RelationType): |
29 permissions = { |
29 __permissions__ = { |
30 'read': ('managers', ), |
30 'read': ('managers', ), |
31 'add': ('managers', ERQLExpression('S bla Y'),), |
31 'add': ('managers', ERQLExpression('S bla Y'),), |
32 'delete': ('managers',), |
32 'delete': ('managers',), |
33 } |
33 } |