Function
zope.securitypolicy.role.unsetIdOnDeactivation

Signature

unsetIdOnDeactivation(role, event)

Documentation String

Unset the permission id up registration deactivation.

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
...         self.name = name
>>> role1 = LocalRole('Role 1', 'A first role')
>>> role1.id = 'role1'
>>> import zope.component.interfaces
>>> event = zope.component.interfaces.Unregistered(
...     Registration(role1, 'role1'))

Now we pass the event into this function, and the id of the role should be set to NULL_ID.

>>> unsetIdOnDeactivation(role1, event)
>>> role1.id
u'<role not activated>'