/// <summary>
        /// Extension method to Sitecore.Data.Items.Item to indicate whether an item  or a
        /// version of an item or any of its ancestors has publishing restrictions. Does
        /// not check publishing targets.
        /// </summary>
        /// <param name="me">The item to check.</param>
        /// <param name="checkAncestors">Whether to check ancestors of the item for
        /// publishing restrictions (does not check version publishing restrictions).
        /// </param>
        /// <param name="requireLatest">Whether to check if this version of the item has
        /// publishing restrictions.</param>
        /// <returns>True if the item or any of its ancestors has publishing restrictions.
        /// </returns>
        public static bool HasPublishingRestrictions(
            this Sitecore.Data.Items.Item me,
            bool checkAncestors,
            bool requireLatest)
        {
            Sitecore.Diagnostics.Assert.IsNotNull(me, "item");

            if (!me.Publishing.IsPublishable(DateTime.Now, checkAncestors))
            {
                return(true);
            }

            if (!requireLatest)
            {
                return(false);
            }

            if (!me.IsLatest())
            {
                return(true);
            }

            Sitecore.Data.Items.Item publishable =
                me.Publishing.GetValidVersion(DateTime.Now, true);

            if (publishable == null || !me.IsSameRevision(publishable))
            {
                return(true);
            }

            return(false);
        }