setIdOnActivation(permission, event)

Documentation String

Set the permission id upon registration activation.

Let's see how this notifier can be used. First we need to create an event using the permission instance and a registration stub:

>>> class Registration:
...     def __init__(self, obj, name):
...         self.component = obj
... = name
>>> perm1 = LocalPermission('Permission 1', 'A first permission')
u'<permission not activated>'
>>> import zope.component.interfaces
>>> event = zope.component.interfaces.Registered(
...     Registration(perm1, 'perm1'))

Now we pass the event into this function, and the id of the permission should be set to 'perm1'.

>>> setIdOnActivation(perm1, event)