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', |
155 'add': ('managers', RRQLExpression('U has_update_permission S')), |
156 'add': ('managers', RRQLExpression('U has_update_permission S')), |
156 'delete': ('managers', RRQLExpression('O owned_by U')), |
157 'delete': ('managers', RRQLExpression('O owned_by U')), |
157 } |
158 } |
158 subject = 'Personne' |
159 subject = 'Personne' |
159 object = 'Societe' |
160 object = 'Societe' |
|
161 constraints = [RQLVocabularyConstraint('S owned_by U'), |
|
162 RQLVocabularyConstraint('S created_by U')] |
160 |
163 |
161 class comments(RelationDefinition): |
164 class comments(RelationDefinition): |
162 subject = 'Comment' |
165 subject = 'Comment' |
163 object = 'Personne' |
166 object = 'Personne' |
164 |
167 |
193 object = ('Bookmark', 'Note') |
196 object = ('Bookmark', 'Note') |
194 |
197 |
195 class evaluee(RelationDefinition): |
198 class evaluee(RelationDefinition): |
196 subject = ('Personne', 'CWUser', 'Societe') |
199 subject = ('Personne', 'CWUser', 'Societe') |
197 object = ('Note') |
200 object = ('Note') |
|
201 constraints = [ |
|
202 RQLVocabularyConstraint('S created_by U'), |
|
203 RQLVocabularyConstraint('S owned_by U'), |
|
204 ] |
198 |
205 |
199 class ecrit_par(RelationType): |
206 class ecrit_par(RelationType): |
200 inlined = True |
207 inlined = True |
201 |
208 |
202 class ecrit_par_1(RelationDefinition): |
209 class ecrit_par_1(RelationDefinition): |