def METHOD_NAME(info, ids=None, emails=None):
    requester = get_user_or_app_from_context(info.context)
    if not requester:
        return models.User.objects.none()
    if requester.has_perms(
        [AccountPermissions.MANAGE_STAFF, AccountPermissions.MANAGE_USERS]
    ):
        qs = models.User.objects.all()
    elif requester.has_perm(AccountPermissions.MANAGE_STAFF):
        qs = models.User.objects.staff()
    elif requester.has_perm(AccountPermissions.MANAGE_USERS):
        qs = models.User.objects.customers()
    elif requester.id:
        # If user has no access to all users, we can only return themselves, but
        # only if they are authenticated and one of requested users
        qs = models.User.objects.filter(id=requester.id)
    else:
        qs = models.User.objects.none()
    if ids:
        ids = {from_global_id_or_error(id, User, raise_error=True)[1] for id in ids}
    if ids and emails:
        return qs.filter(Q(id__in=ids) | Q(email__in=emails))
    elif ids:
        return qs.filter(id__in=ids)
    return qs.filter(email__in=emails)