def limit_permissions(permissions: dict, limit_filter: dict) -> dict:
    """
    Make sure permission values in `permissions` do not exceed those in `limit_filter`. Returns a filtered set of
    permissions.

    :param limit_filter: the limiting permissions that cannot be exceeded
    :param permissions: a permissions to filter
    :return: filtered permissions

    """
    return {p: (permissions.get(p, False) and limit_filter[p]) for p in permissions}