equal
deleted
inserted
replaced
20 SubjectRelation, RichString, String, Int, Float, |
20 SubjectRelation, RichString, String, Int, Float, |
21 Boolean, Datetime, TZDatetime, Bytes) |
21 Boolean, Datetime, TZDatetime, Bytes) |
22 from yams.constraints import SizeConstraint |
22 from yams.constraints import SizeConstraint |
23 from cubicweb.schema import (WorkflowableEntityType, |
23 from cubicweb.schema import (WorkflowableEntityType, |
24 RQLConstraint, RQLUniqueConstraint, |
24 RQLConstraint, RQLUniqueConstraint, |
|
25 RQLVocabularyConstraint, |
25 ERQLExpression, RRQLExpression) |
26 ERQLExpression, RRQLExpression) |
26 |
27 |
27 class Affaire(WorkflowableEntityType): |
28 class Affaire(WorkflowableEntityType): |
28 __permissions__ = { |
29 __permissions__ = { |
29 'read': ('managers', |
30 'read': ('managers', |
149 'add': ('managers', RRQLExpression('U has_update_permission S')), |
150 'add': ('managers', RRQLExpression('U has_update_permission S')), |
150 'delete': ('managers', RRQLExpression('O owned_by U')), |
151 'delete': ('managers', RRQLExpression('O owned_by U')), |
151 } |
152 } |
152 subject = 'Personne' |
153 subject = 'Personne' |
153 object = 'Societe' |
154 object = 'Societe' |
|
155 constraints = [RQLVocabularyConstraint('S owned_by U'), |
|
156 RQLVocabularyConstraint('S created_by U')] |
154 |
157 |
155 class comments(RelationDefinition): |
158 class comments(RelationDefinition): |
156 subject = 'Comment' |
159 subject = 'Comment' |
157 object = 'Personne' |
160 object = 'Personne' |
158 |
161 |
187 object = ('Bookmark', 'Note') |
190 object = ('Bookmark', 'Note') |
188 |
191 |
189 class evaluee(RelationDefinition): |
192 class evaluee(RelationDefinition): |
190 subject = ('Personne', 'CWUser', 'Societe') |
193 subject = ('Personne', 'CWUser', 'Societe') |
191 object = ('Note') |
194 object = ('Note') |
|
195 constraints = [ |
|
196 RQLVocabularyConstraint('S created_by U'), |
|
197 RQLVocabularyConstraint('S owned_by U'), |
|
198 ] |
192 |
199 |
193 class ecrit_par(RelationType): |
200 class ecrit_par(RelationType): |
194 inlined = True |
201 inlined = True |
195 |
202 |
196 class ecrit_par_1(RelationDefinition): |
203 class ecrit_par_1(RelationDefinition): |