Is there a way to restrict access to blogengine only to users login?
Basically I wanted to prevent people from viewing blog entries unless
they are logged in? I tried disabling the publish checkbox but this then
prevents posts from being archived?
Thanks in advance,
BlogEngine does not provide this functionality.
However, it is trivial to implement. Simply add an extension that replaces the post content with an empty string (or message) if the user is not authenticated.
If you want to do this for certain posts, just embed a token in posts that you want to conceal, and have your extension search for the token.
Here's a simple example which does the same for comments. You'd need to hook the Post.Serving event instead.
/// Summary description for CommentVeiler
[Extension("Hides comments from any non-members", "1.0", "My Name")]
public class CommentVeiler
static protected ExtensionSettings _settings = null;
Comment.Serving += new EventHandler<ServingEventArgs>(Comment_Serving);
ExtensionSettings settings = new ExtensionSettings("CommentVeiler");
settings.IsScalar = true;
settings.AddParameter("HiddenCommentText", "Hidden Comment Text", 100, true);
settings.AddValue("HiddenCommentText", "This comment is visible to members only.");
_settings = ExtensionManager.InitSettings("CommentVeiler", settings);
/// Called when a comment is served. If the current context indicates that the
/// user is not authorized/logged into the site, the comment will be hidden.
/// <param name="sender"></param>
/// <param name="e"></param>
void Comment_Serving(object sender, ServingEventArgs e)
if (false == System.Threading.Thread.CurrentPrincipal.Identity.IsAuthenticated)
e.Body = _settings.GetSingleValue("HiddenCommentText");