0

I'd like to attach the firing of an event with the "manage_setLocalRoles" method. Like this:

def send_participation_request(self): 
    review_state = self.portal_workflow.getInfoFor(self.context, "review_state", "") 
    if review_state =="public":
        self.context.manage_setLocalRoles(user.id,["Role"]) #fire event
        self.context.reindexObjectSecurity()
    return False

Any suggestions?

jtmolon
  • 415
  • 2
  • 8

1 Answers1

1

.manage_setLocalRoles() does not emit any events. The code predates Zope 3 events.

You'd have to create a monkey-patch hook instead, or otherwise emit an event yourself whenever your own code calls that method.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
  • @jtmolon: `.reindexObject()` does not emit an event either. There are, however, workflow events when transitions occur, perhaps that is what you are looking for instead? – Martijn Pieters Mar 27 '13 at 14:50
  • Actually I'm just changing the role of a member in a content, there's no workflow transition in the process. What I need to do is update a list after changing the role. – jtmolon Mar 27 '13 at 15:00