Blog Site in Anonymous Use

December 22 2010 127 comments

Anonymous user cannot enter a blog entry in a SharePoint site if ViewFormPagesLockDown feature is active at site collection level and ViewFormPagesLockDown feature is active if site collection is based on publishing portal. After googling we came accross plenty of resources considering this matter:

We didn’t want use the solutions suggested in the links above. To disable the ViewFormPagesLockDown “…leaves you wide open from a security perspective…”. To have our blog site in another site collection. Well that’s just not what we want to do to solve this tiny little thing with permissions.

Me and Aapo dug with reflector into ViewFormPagesLockDown feature and found out what the feature receiver does.

The highlighted sections of the feature receiver show what happens to Guest’s permissions at rootweb level when you disable ViewFormPagesLockDown site collection level feature.

So why not just take the solution from where it is and develop a web scoped feature which does the exactly same thing to the blog site but not to all webs in the site collection because that’s not what we want.

Develop a feature receiver as follows:

using System;
using Microsoft.SharePoint;

namespace My.Assembly
    public class FormPagesLockDownReleaseReceiver : SPFeatureReceiver
        public override void FeatureActivated(SPFeatureReceiverProperties
            using (var web = (SPWeb)properties.Feature.Parent)
                var anonymousState = web.AnonymousState;
                // continue only if anonymous use is enabled
                if (anonymousState == SPWeb.WebAnonymousState.Disabled)
                web.AllowUnsafeUpdates = true;
                 // break inheritance to set permissions per site
                web.RoleDefinitions.BreakInheritance(true, true);
                // permission granting from LockDownViewFormPages
                var byType = web.RoleDefinitions.GetByType(SPRoleType.Guest);
                byType.BasePermissions |= SPBasePermissions.EmptyMask |
                byType.BasePermissions |= SPBasePermissions.UseRemoteAPIs;
                // reset the anonymous state programmatically
                web.AnonymousState = SPWeb.WebAnonymousState.Disabled;
                web.AnonymousState = anonymousState;
                web.AllowUnsafeUpdates = false;

Resetting the anonymous state is just a thing you would have to do from UI when you toggle permissions. Lockdown Mode in SharePoint 2010: “If anonymous is already setup, you may need to disable\re-enable anonymous on the site.”

Then a web scoped feature that consumes the receiver:

<?xml version="1.0" encoding="utf-8" ?>
  Title="Blog Anonymous Access Staplee"
  Description="Enables Anonymous Access to Blog Entries"


You could set the feature hidden to avoid accidental feature activations.

Then a stapling mechanism at site collection level to staple the feature to Blog sites by default.


<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="">
      <!--Staple FormPagesLockDownReleaseReceiver to Blog sites -->
    TemplateName="BLOG#0" />
<?xml version="1.0" encoding="utf-8" ?>
    Title="Blog Anonymous Enabling Stapler"
    Description="Staples Anonymous Access to Created Blog Sites"
        <ElementManifest Location="Stapling.xml" />

Voila, you have a mechanism to allow viewing form pages only in blog sites when you activate the stapler feature at site collection level. Of course, if you want, you could even set the needed permissions at list level in the Blog site, I suppose, but that’s not what we’ve done here.

Popularity: 4% [?]

127 comments to “Blog Site in Anonymous Use”

  1. [...] Blog Site in Anonymous Use (SharePoint Blues) Anonymous user cannon enter a blog entry in a SharePoint site if ViewFormPagesLockDown feature is active at site collection level and ViewFormPagesLockDown feature is active if site collection is based on publishing portal. After Googling we came across plenty of resources considering this matter:  [...]

  2. [...] Blog Site in Anonymous Use (SharePoint Blues)Anonymous user cannon enter a blog entry in a SharePoint site if ViewFormPagesLockDown feature is active at site collection level and ViewFormPagesLockDown feature is active if site collection is based on publishing portal. After Googling we came across plenty of resources considering this matter: [...]

  3. Thomas Carpe says:

    Yes, this is exactly what I needed! Thanks guys for having a similar mentality and just digging right into the guts of SharePoint to cut it open, do some surgery, and “staple” it back together again. ;-) You saved my day.

  4. [...] a post and see the details. They were being prompted to log in. After some looking around I found this great post from Juha Pitkänen. It turns out that there is a ViewFormPagesLockDown feature that gets activated [...]

  5. blog IT says:

    I used to be very happy to seek out this internet-site.I needed to thanks in your time for this excellent learn!! I undoubtedly having fun with each little bit of it and I have you bookmarked to take a look at new stuff you weblog post.

  6. DarkS0ul says:

    I am still new to SharePoint programming and hence “Then a web scoped feature that consumes the receiver” threw me off a bit. Would it be possible to share the source code so I can better understand each step, thank you so much.

  7. Antonietta says:

    With havin so much written content do you ever run into any issues of plagorism
    or copyright violation? My site has a lot of completely unique content I’ve either written myself or outsourced but it looks like a lot of it is popping it up all over the web without my agreement. Do you know any methods to help protect against content from being stolen? I’d truly appreciate it.

  8. I am regular visitor, how are you everybody?
    This piece of writing posted at this site is really pleasant.

    Here is my homepage … most effective Male enhancement Product

  9. Launa says:

    You can definitely see your expertise within the article you write.
    The sector hopes for even more passionate writers
    like you who aren’t afraid to mention how they believe. All the time go after your heart.

  10. videoporno says:

    I would like to thank you for the efforts you’ve put in writing this website.
    I am hoping to see the same high-grade blog posts by you later on as well.
    In truth, your creative writing abilities has encouraged
    me to get my own, personal blog now ;)

  11. says:

    You can transform yourself to the male of their choice according to
    their personality type. Most of the time the client is not aware of these
    habits, and it requires some real work on my part just to convince them that they exist in the first place.
    Real understanding of women gives you a distinct
    advantage over guys have no clue.

    Here is my webpage – Christian Hudson (

  12. Stuart says:

    WOW just what I was looking for. Came here by searching for
    click here

  13. This electronic smoke starter unit is not worth
    what you are paying for, and will no doubt break and abandoning you
    need to purchase another electronic smoke starter pack.

    The hazard of traditional tobacco cigarettes has been preached too no end over
    time. It should be used with caution since not only do the FDA tests show there are dangers,
    but there are other dangers to e-cigarettes to consider as well.

    Visit my web site; sigaretta elettronica quale scegliere

  14. Moyerdds says:

    Also the oral filling and also products for teeth repair that were made use of previously for aesthetic dentistry were made
    from gold, amalgam as well as other steels. Aesthetic dental care
    NYC provides a variety of alternatives to the individual that would like to adopt a
    restructuring of his or her dental structure. The most usual referral for a cosmetic oral treatment is
    that of teeth lightening. Lightening is the most common cosmetic dental procedure.

  15. Good Way Of Telling, Good Post To Take Facts Regarding My Presentation Subject Matter, Which I Am Going To Deliver In My College

  16. Norine Bolliger says:


    You Need Leads, Sales, Conversions, Traffic for ?
    I Will Findet…

    Don’t believe me? Since you’re reading this message then you’re living proof that contact form advertising works!
    We can send your ad to people via their Website Contact Form.
    The advantage of this kind of promotion is that messages sent through feedback forms are automatically whitelisted.


    Do not forget to read Review to convince you, is already being tested by many people who have trusted it !!

    feedback team

    unsubscribe by reply this email

  17. Denis Kaylock says:

    Good day

    I Will Provide 20.000 Backlinks From Blog Comments for,
    By post 400k blog comments from where you will receive at least 20.000 live links.

    – Use unlimited URLs
    – Use unlimited keywords (anchor text)
    – All languages supported
    – Link report included

    Boost your Google ranking, get more traffic and more sales!


  18. Cassandra D. Everhart says:

    I just added this web site to my feed reader, excellent stuff. power washing

  19. I love to see your blog every single day. So excellent!

  20. Hayley Fernandes says:

    Hello there

    I just checked out your website and wanted to find out if you need help for SEO Link Building ?

    If you aren’t using SEO Software then you will know the amount of work load involved in creating accounts, confirming emails and submitting your contents to thousands of websites.

    With THIS SOFTWARE the link submission process will be the easiest task and completely automated, you will be able to build unlimited number of links and increase traffic to your websites which will lead to a higher number of customers and much more sales for you.

    IF YOU ARE INTERESTED, We offer you 7 days free trial

    Kind Regards,
    Hayley Fernandes ! Business Development Manager

  21. I hope this work with mine. Thank you for sharing this.

  22. says:

    Thanks for sharing the codes. We might be able to use some of them.

  23. You have an organize codes. Thanks!

  24. Kate says:

    Thanks for sharing this article!

  25. Great site! Thanks for sharing this to the public.

  26. Check us Out says:

    Impressive solution! THanks for sharing them here.

  27. Thanks for posting this content here.

  28. Awesome post, thanks for the share.

  29. About us says:

    Thanks for the share.

  30. Link here says:

    Awesome information you’ve posted here.

  31. It’s nice to see this great post.

  32. Anonymous says:

    What’s up, after reading this amazing paragraph i am too cheerful to share my experience here with

  33. It’s great to be on this site with nice post.

  34. Erwin says:

    Useful Content Tow Truck

  35. Click here says:

    Great to see this information.

  36. Very interesting article.

  37. anthony fant says:

    I want to blog about teaching but my school district will not allow it because they don’t want what staff says to be affiliated with them.

  38. david butler says:

    For someone who just inherited a SharePoint kingdom, they’re unbelievably helpful.

  39. Demi says:

    Informative site, so nice tow truck

Leave a Reply