288 if role == 'object'and not rdef.has_perm( |
288 if role == 'object'and not rdef.has_perm( |
289 req, 'add', toeid=entity.eid): |
289 req, 'add', toeid=entity.eid): |
290 continue |
290 continue |
291 # check the target types can be added as well |
291 # check the target types can be added as well |
292 if teschema.may_have_permission('add', req): |
292 if teschema.may_have_permission('add', req): |
|
293 print 'hop', rschema, teschema, role |
293 yield rschema, teschema, role |
294 yield rschema, teschema, role |
294 |
295 |
295 def linkto_url(self, entity, rtype, etype, target): |
296 def linkto_url(self, entity, rtype, etype, target): |
296 return self._cw.build_url('add/%s' % etype, |
297 return self._cw.build_url('add/%s' % etype, |
297 __linkto='%s:%s:%s' % (rtype, entity.eid, target), |
298 __linkto='%s:%s:%s' % (rtype, entity.eid, target), |
402 |
403 |
403 ## default actions ui configuration ########################################### |
404 ## default actions ui configuration ########################################### |
404 |
405 |
405 addmenu = uicfg.actionbox_appearsin_addmenu |
406 addmenu = uicfg.actionbox_appearsin_addmenu |
406 addmenu.tag_subject_of(('*', 'require_permission', '*'), False) |
407 addmenu.tag_subject_of(('*', 'require_permission', '*'), False) |
407 addmenu.tag_subject_of(('*', 'wf_info_for', '*'), False) |
|
408 addmenu.tag_object_of(('*', 'wf_info_for', '*'), False) |
|
409 addmenu.tag_object_of(('*', 'state_of', 'CWEType'), True) |
|
410 addmenu.tag_object_of(('*', 'transition_of', 'CWEType'), True) |
|
411 addmenu.tag_object_of(('*', 'relation_type', 'CWRType'), True) |
408 addmenu.tag_object_of(('*', 'relation_type', 'CWRType'), True) |
412 addmenu.tag_object_of(('*', 'from_entity', 'CWEType'), False) |
409 addmenu.tag_object_of(('*', 'from_entity', 'CWEType'), False) |
413 addmenu.tag_object_of(('*', 'to_entity', 'CWEType'), False) |
410 addmenu.tag_object_of(('*', 'to_entity', 'CWEType'), False) |
414 addmenu.tag_object_of(('*', 'in_group', 'CWGroup'), True) |
411 addmenu.tag_object_of(('*', 'in_group', 'CWGroup'), True) |
415 addmenu.tag_object_of(('*', 'bookmarked_by', 'CWUser'), True) |
412 addmenu.tag_object_of(('*', 'bookmarked_by', 'CWUser'), True) |
416 addmenu.tag_subject_of(('Transition', 'destination_state', '*'), True) |
|
417 addmenu.tag_object_of(('*', 'allowed_transition', 'Transition'), True) |
|
418 addmenu.tag_object_of(('*', 'destination_state', 'State'), True) |
|
419 addmenu.tag_subject_of(('State', 'allowed_transition', '*'), True) |
|