@subscriber(ResourceChanged, for_resources=('group',), for_actions=(ACTIONS.DELETE,))
def on_groups_deleted(event):
 permission_backend = event.request.registry.permission
 for change in event.impacted_records:
  group = change['old']
  bucket_id = event.payload['bucket_id']
  group_uri = utils.instance_uri(event.request, 'group', bucket_id=bucket_id, id=group['id'])
  permission_backend.remove_principal(group_uri)

@ subscriber ( ResourceChanged , for_resources = ( 'group' , ) , for_actions = ( ACTIONS . DELETE , ) ) def on_groups_deleted ( event ) : permission_backend = event . request . registry . permission for change in event . impacted_records : group = change [ 'old' ] bucket_id = event . payload [ 'bucket_id' ] group_uri = utils . instance_uri ( event . request , 'group' , bucket_id = bucket_id , id = group [ 'id' ] ) permission_backend . remove_principal ( group_uri )
some groups were deleted .