def get_telecom_model_queryset(request, model):
    """
    The queryset of models `Isp`, `IspGroup`, `PrefixListUpdateTask` with
    filter depending on user's role/identity/group. The views below will use
    this as a basic queryset. This ensures that users won't accidentally see
    or touch those they shouldn't.
    """
    queryset = model.objects.all()
    role = request.user.profile.activated_role
    deps = request.user.groups.filter(groupprofile__is_department=True)
    if not role:
        return queryset.filter(created_by__groups__in=deps).distinct()
    supervise_roles = role.groupprofile.supervise_roles.all()
    if not supervise_roles:
        return queryset.filter(created_by__groups__in=deps).distinct()
    return queryset.filter(created_by__groups__in=supervise_roles).distinct()