This project is read-only.

Publish Checkbox not Working

Topics: ASP.NET 2.0, Business Logic Layer
Feb 1, 2013 at 2:52 AM
All posts are viewable even when Publish checkbox is unchecked. This is set as a private blog.
Mar 4, 2013 at 6:15 AM
I just setup a BlogEngine.NET on Azure and I have the same problem.

All posts are visible whether the Publish checkbox is set or not and it does not matter what the Publish date is set to. Anyway around this or do I need to install a different software package...

WordPress blows sometimes..... but it does work.... :-(
Mar 4, 2013 at 11:33 AM
Edited Mar 4, 2013 at 11:40 AM
Likely because you are logged in with edit rights. Try logging in as a user with only read rights.

One option is to disable viewing for all users.

In BlogEngine.Core\Post.cs, change the following code to the IsVisible routine. Comment (or delete) out two lines
and add return false.
        public bool IsVisible
                if (this.IsDeleted)
                    return false;
                else if (this.IsPublished && this.DateCreated <= DateTime.Now.AddHours(BlogSettings.Instance.Timezone))
                    return true;
              //  else if (Security.IsAuthorizedTo(Rights.ViewUnpublishedPosts))  //----- COMMENT OUT OR DELETE
              //      return true;   //----- COMMENT OUT OR DELETE
                return false;  // ----- ADD THIS LINE