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 |
|
172 inlined = True |
|
173 |
|
174 class transition_of(RelationType): |
|
175 """link a transition to one or more workflow""" |
171 permissions = META_RTYPE_PERMS |
176 permissions = META_RTYPE_PERMS |
172 inlined = True |
177 inlined = True |
173 |
178 |
174 class transition_of(RelationType): |
|
175 """link a transition to one or more workflow""" |
|
176 permissions = META_RTYPE_PERMS |
|
177 inlined = True |
|
178 |
|
179 class subworkflow(RelationType): |
179 class subworkflow(RelationType): |
180 """link a transition to one or more workflow""" |
180 """link a transition to one or more workflow""" |
181 permissions = META_RTYPE_PERMS |
181 __permissions__ = META_RTYPE_PERMS |
182 inlined = True |
182 inlined = True |
183 |
183 |
184 class exit_point(RelationType): |
184 class exit_point(RelationType): |
185 """link a transition to one or more workflow""" |
185 """link a transition to one or more workflow""" |
186 permissions = META_RTYPE_PERMS |
186 __permissions__ = META_RTYPE_PERMS |
187 |
187 |
188 class subworkflow_state(RelationType): |
188 class subworkflow_state(RelationType): |
189 """link a transition to one or more workflow""" |
189 """link a transition to one or more workflow""" |
190 permissions = META_RTYPE_PERMS |
190 __permissions__ = META_RTYPE_PERMS |
191 inlined = True |
191 inlined = True |
192 |
192 |
193 class initial_state(RelationType): |
193 class initial_state(RelationType): |
194 """indicate which state should be used by default when an entity using |
194 """indicate which state should be used by default when an entity using |
195 states is created |
195 states is created |
196 """ |
196 """ |
197 permissions = META_RTYPE_PERMS |
197 __permissions__ = META_RTYPE_PERMS |
198 inlined = True |
198 inlined = True |
199 |
199 |
200 class destination_state(RelationType): |
200 class destination_state(RelationType): |
201 """destination state of a transition""" |
201 """destination state of a transition""" |
202 permissions = META_RTYPE_PERMS |
202 __permissions__ = META_RTYPE_PERMS |
203 inlined = True |
203 inlined = True |
204 |
204 |
205 class allowed_transition(RelationType): |
205 class allowed_transition(RelationType): |
206 """allowed transition from this state""" |
206 """allowed transition from this state""" |
207 permissions = META_RTYPE_PERMS |
207 __permissions__ = META_RTYPE_PERMS |
208 |
208 |
209 |
209 |
210 # "abstract" relations, set by WorkflowableEntityType ########################## |
210 # "abstract" relations, set by WorkflowableEntityType ########################## |
211 |
211 |
212 class custom_workflow(RelationType): |
212 class custom_workflow(RelationType): |
213 """allow to set a specific workflow for an entity""" |
213 """allow to set a specific workflow for an entity""" |
214 permissions = META_RTYPE_PERMS |
214 __permissions__ = META_RTYPE_PERMS |
215 |
215 |
216 cardinality = '?*' |
216 cardinality = '?*' |
217 constraints = [RQLConstraint('S is ET, O workflow_of ET')] |
217 constraints = [RQLConstraint('S is ET, O workflow_of ET')] |
218 object = 'Workflow' |
218 object = 'Workflow' |
219 |
219 |
220 |
220 |
221 class wf_info_for(RelationType): |
221 class wf_info_for(RelationType): |
222 """link a transition information to its object""" |
222 """link a transition information to its object""" |
223 # 'add' security actually done by hooks |
223 # 'add' security actually done by hooks |
224 permissions = { |
224 __permissions__ = { |
225 'read': ('managers', 'users', 'guests',), |
225 'read': ('managers', 'users', 'guests',), |
226 'add': ('managers', 'users', 'guests',), |
226 'add': ('managers', 'users', 'guests',), |
227 'delete': (), |
227 'delete': (), |
228 } |
228 } |
229 inlined = True |
229 inlined = True |