delete rights when deleting an entity + tests