'Used for deleting a user from a tenant.
In the legacy data model removing a user from a tenant required
deleting a role.
To emulate this, we encode the tenant and role in the role_ref_id,
and if this happens to be the last role for the user-tenant pair,
we remove the user from the tenant.'

@controller.v2_deprecated
def delete_role_ref(self, request, user_id, role_ref_id):

    self.assert_admin(request)
    role_ref_ref = urllib.parse.parse_qs(role_ref_id)
    tenant_id = role_ref_ref.get('tenantId')[0]
    role_id = role_ref_ref.get('roleId')[0]
    self.assignment_api.remove_role_from_user_and_project(user_id, tenant_id, role_id)
