'Migrate the Users and Groups so they extend AccessEntity'

def forwards(self, orm):

    for user in orm['core.User'].objects.all():
        entity = orm['core.AccessEntity'].objects.create()
        entity.id = user.id
        entity.save()
        user.accessentity_ptr = entity
        user.save()
    for group in orm['core.Group'].objects.all():
        group.accessentity_ptr = orm['core.AccessEntity'].objects.create()
        group.accessentity_ptr.save()
        if group.parent:
            parent = orm['core.Group'].objects.get(id=group.parent_id)
            group.parent_id = parent.accessentity_ptr_id
        group.save()
    for user in orm['core.User'].objects.all():
        group = orm['core.Group'].objects.get(pk=user.default_group_id)
        user.default_group = group.accessentity_ptr
        user.save()
    for obj in orm['core.Object'].objects.all():
        obj.creator = obj.user
        obj.save()
