“Access Denied” Error in Discussion List Templates
February 26, 2009
Another strange error happened to me on customer premises.
THE SYMPTOMS
You have developed a custom discussion list in SharePoint. You have saved the custom discussion list as a template. You create a new discussion list from this template.
When you create a new thread or a post in this new list (created from a template), you don’t see the “Edit Properties” or “Delete” buttons, even if you have the right permissions. Additionally, you might have “Access Denied” errors if you try to edit the thread or the post directly.
THE CAUSE
I was puzzled by this one at first. However, the customer contact (thank you, Toni) had previously found a useful blog entry, related to the problem although not exactly the same. To make it short, the problem resides in the fact that SharePoint somehow corrupts the security information saved for the list when it saves the list as template. More specifically, it drops the RenderXMLUsingPattern boolean attribute in PermMask field of the discussion list.
This seems to be a known bug in SharePoint, confirmed by Microsoft.
THE SOLUTION
There are several possible solutions, depending on whether we want to fix an existing discussion list created with the “broken” template or we want to fix the template.
Fix an Existing Discussion List
In essence, we need to change PermMask field of the existing list and add the missing attribute (RenderXMLUsingPattern=”TRUE”). You can do it with:
- a tool that exposes SharePoint API (like SharePoint Manager 2007 or WSS Explorer)
- PowerShell script that uses SharePoint API (similar to a custom console application solution)
- custom console application (you can use the one that has been created by Anthony Odole or the one created by waqas)
Fix the Template
The process here is to repack the template with the correct XML.
- Download the template STP file from the List Templates of your site collection to your local disk
- Change the file extension to CAB
- Extract the contents of the CAB file into a folder
- Open manifest.xml file in the folder
- Look for the Field ID=”{BA3C27EE-4791-4867-8821-FF99000BAC98}” Name=”PermMask” entry. Add the following attribute in the Field node: RenderXMLUsingPattern=”TRUE”
- Repack the files in the folder with a CAB creation utility (such as CAB Maker), creating a new CAB file
- Change the file extension to STP
- Upload the new template to List Templates of your site collection