Archive for December, 2011

Anonymous Access and Publishing Web Pages List

December 22 2011 25 comments

As You know, using PublishingWeb.GetPublishingWeb(web) method causes Access Denied exception for anonymous users. You will also get the same exception if you try to access the PublishingWeb.GetPagesListId(web) or PublishingWeb.GetPagesListName(web) methods.
There are solutions here and here and in many other blogs. These solutions use SPSecurity.RunWithElevatedPrivileges,…

Read more »

Remove Keys From PropertyBag on FeatureDeactivating Override

December 13 2011 10 comments

You can add keys to spweb propertybag trough a feature using CAML:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <PropertyBag ParentType="Web" RootWebOnly="False">
    <Property Name="MyCustomProperty"
             Type="string" Value="MyValue" />
  </PropertyBag>
</Elements>

The property is…

Read more »