Dave Fregon wrote:
What I mean, is move the script into the skins folder where you can put
a proxy on it, and create a script to replace it in the portal_worflow,
that calls it.
example in the workflow script just :
context.move_newsitem(state_change)
that calls the move_newsitem script in the skins folder, that has the
proxy on it.
thanks, Dave; I did the following:
1. create a script inside "skins" folder named archiveItem.py; this
script contains the script previously contained inside the workflow.
2. replace the workflow script with: "context.archiveItem(state_change)"
3. create a new test to see if the item is moved:
def testArchiveItem(self):
""" test the script inside the workflow """
self.workflow = self.portal.portal_workflow
self.folder.invokeFactory('News Item', 'news1')
self.object = getattr(self.folder, 'news1')
self.setRoles(['Manager', 'Member'])
self.folder.archiveItem(self)
self.assertFailUnless(getattr(self.folder, 'news1', None) is None)
test raises the same "CopyError, eNotSupported % escape(id)" as before
in this line:
destination.manage_pasteObjects(obj_parent.manage_cutObjects(object_id))
probably putting a proxy on the script means more than just adding
"self.setRoles(['Manager', 'Member'])" so I also tried replacing that
with "self.folder.archiveItem.manage_proxy(roles=('Manager',))" and that
raises an "AttributeError: manage_proxy" error. do scripts on "skins"
have the same permissions?
sorry for this, but I'm not an expert on the topic.
do I have to do something else?
regards
_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers