124 |
124 |
125 |
125 |
126 class TrInfo(EntityType): |
126 class TrInfo(EntityType): |
127 """workflow history item""" |
127 """workflow history item""" |
128 # 'add' security actually done by hooks |
128 # 'add' security actually done by hooks |
129 permissions = { |
129 __permissions__ = { |
130 'read': ('managers', 'users', 'guests',), # XXX U has_read_permission O ? |
130 'read': ('managers', 'users', 'guests',), # XXX U has_read_permission O ? |
131 'add': ('managers', 'users', 'guests',), |
131 'add': ('managers', 'users', 'guests',), |
132 'delete': (), # XXX should we allow managers to delete TrInfo? |
132 'delete': (), # XXX should we allow managers to delete TrInfo? |
133 'update': ('managers', 'owners',), |
133 'update': ('managers', 'owners',), |
134 } |
134 } |
140 by_transition = SubjectRelation('BaseTransition', cardinality='?*') |
140 by_transition = SubjectRelation('BaseTransition', cardinality='?*') |
141 comment = RichString(fulltextindexed=True) |
141 comment = RichString(fulltextindexed=True) |
142 # get actor and date time using owned_by and creation_date |
142 # get actor and date time using owned_by and creation_date |
143 |
143 |
144 class from_state(RelationType): |
144 class from_state(RelationType): |
145 permissions = HOOKS_RTYPE_PERMS.copy() |
145 __permissions__ = HOOKS_RTYPE_PERMS.copy() |
146 inlined = True |
146 inlined = True |
147 |
147 |
148 class to_state(RelationType): |
148 class to_state(RelationType): |
149 permissions = { |
149 __permissions__ = { |
150 'read': ('managers', 'users', 'guests',), |
150 'read': ('managers', 'users', 'guests',), |
151 'add': ('managers',), |
151 'add': ('managers',), |
152 'delete': (), |
152 'delete': (), |
153 } |
153 } |
154 inlined = True |
154 inlined = True |
155 |
155 |
156 class by_transition(RelationType): |
156 class by_transition(RelationType): |
157 # 'add' security actually done by hooks |
157 # 'add' security actually done by hooks |
158 permissions = { |
158 __permissions__ = { |
159 'read': ('managers', 'users', 'guests',), |
159 'read': ('managers', 'users', 'guests',), |
160 'add': ('managers', 'users', 'guests',), |
160 'add': ('managers', 'users', 'guests',), |
161 'delete': (), |
161 'delete': (), |
162 } |
162 } |
163 inlined = True |
163 inlined = True |
164 |
164 |
165 class workflow_of(RelationType): |
165 class workflow_of(RelationType): |
166 """link a workflow to one or more entity type""" |
166 """link a workflow to one or more entity type""" |
167 permissions = META_RTYPE_PERMS |
167 __permissions__ = META_RTYPE_PERMS |
168 |
168 |
169 class state_of(RelationType): |
169 class state_of(RelationType): |
170 """link a state to one or more workflow""" |
170 """link a state to one or more workflow""" |
171 permissions = META_RTYPE_PERMS |
171 __permissions__ = META_RTYPE_PERMS |
172 |
172 |
173 class transition_of(RelationType): |
173 class transition_of(RelationType): |
174 """link a transition to one or more workflow""" |
174 """link a transition to one or more workflow""" |
175 permissions = META_RTYPE_PERMS |
175 __permissions__ = META_RTYPE_PERMS |
176 |
176 |
177 class subworkflow(RelationType): |
177 class subworkflow(RelationType): |
178 """link a transition to one or more workflow""" |
178 """link a transition to one or more workflow""" |
179 permissions = META_RTYPE_PERMS |
179 __permissions__ = META_RTYPE_PERMS |
180 inlined = True |
180 inlined = True |
181 |
181 |
182 class exit_point(RelationType): |
182 class exit_point(RelationType): |
183 """link a transition to one or more workflow""" |
183 """link a transition to one or more workflow""" |
184 permissions = META_RTYPE_PERMS |
184 __permissions__ = META_RTYPE_PERMS |
185 |
185 |
186 class subworkflow_state(RelationType): |
186 class subworkflow_state(RelationType): |
187 """link a transition to one or more workflow""" |
187 """link a transition to one or more workflow""" |
188 permissions = META_RTYPE_PERMS |
188 __permissions__ = META_RTYPE_PERMS |
189 inlined = True |
189 inlined = True |
190 |
190 |
191 class initial_state(RelationType): |
191 class initial_state(RelationType): |
192 """indicate which state should be used by default when an entity using |
192 """indicate which state should be used by default when an entity using |
193 states is created |
193 states is created |
194 """ |
194 """ |
195 permissions = META_RTYPE_PERMS |
195 __permissions__ = META_RTYPE_PERMS |
196 inlined = True |
196 inlined = True |
197 |
197 |
198 class destination_state(RelationType): |
198 class destination_state(RelationType): |
199 """destination state of a transition""" |
199 """destination state of a transition""" |
200 permissions = META_RTYPE_PERMS |
200 __permissions__ = META_RTYPE_PERMS |
201 inlined = True |
201 inlined = True |
202 |
202 |
203 class allowed_transition(RelationType): |
203 class allowed_transition(RelationType): |
204 """allowed transition from this state""" |
204 """allowed transition from this state""" |
205 permissions = META_RTYPE_PERMS |
205 __permissions__ = META_RTYPE_PERMS |
206 |
206 |
207 |
207 |
208 # "abstract" relations, set by WorkflowableEntityType ########################## |
208 # "abstract" relations, set by WorkflowableEntityType ########################## |
209 |
209 |
210 class custom_workflow(RelationType): |
210 class custom_workflow(RelationType): |
211 """allow to set a specific workflow for an entity""" |
211 """allow to set a specific workflow for an entity""" |
212 permissions = META_RTYPE_PERMS |
212 __permissions__ = META_RTYPE_PERMS |
213 |
213 |
214 cardinality = '?*' |
214 cardinality = '?*' |
215 constraints = [RQLConstraint('S is ET, O workflow_of ET')] |
215 constraints = [RQLConstraint('S is ET, O workflow_of ET')] |
216 object = 'Workflow' |
216 object = 'Workflow' |
217 |
217 |
218 |
218 |
219 class wf_info_for(RelationType): |
219 class wf_info_for(RelationType): |
220 """link a transition information to its object""" |
220 """link a transition information to its object""" |
221 # 'add' security actually done by hooks |
221 # 'add' security actually done by hooks |
222 permissions = { |
222 __permissions__ = { |
223 'read': ('managers', 'users', 'guests',), |
223 'read': ('managers', 'users', 'guests',), |
224 'add': ('managers', 'users', 'guests',), |
224 'add': ('managers', 'users', 'guests',), |
225 'delete': (), |
225 'delete': (), |
226 } |
226 } |
227 inlined = True |
227 inlined = True |