SharePoint Bug
Sometime I had a stress with SharePoint customization, especially on XSLT data transform.
My scenarios is:
- Create a custom view for any list.
- Customize XSLT to render UI for my stituation.
My Problem is:
- With authenticated users, it works fine and smoothly
- Got a notice: Access denied. You do not have permission to perform this action or access this resource for Anonymous users.
I am a "SharePointism", so the first thing I looked into the SharePoint log file. it's very lucky, I got the message: "Error while executing web part: System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Microsoft.SharePoint.Library.SPRequest.UpdateWebPartCache(String bstrWebUrl, Boolean bAllUsers, String bstrID, Byte[]& ppsaData, Boolean fOMCall) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CacheWriteInternal(Guid storageKey, Byte[] cacheData, Storage storage, Boolean omCall) at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.get_CustomizedXsl() at Microsoft.SharePoint.WebPartPages.BaseXsltListWebPart.LoadXslCompiledTransform(WSSXmlUrlResolver someXmlResolver) at Microsoft.SharePoint.WebPartPages.DataFormWebPart.GetXslCompiledTransform() at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTra..."
Just guess that because I turned on the "Data Web Part Caching" and it seems turned on automatically. So, I disable (remove the checked) for this button. And....oh la la... it still doesn't work. However, we should not do like that because the message from SharePoint is not able to update "Cache". So, I tried to change the value CacheXslStorage="false" and ViewFlag="8", but it still end up with "Access denied".
However, i will work fine if there is an authenticated user view the blog detail first, then everybody can view this post without error. Maybe it's WAD or Bug of SharePoint 2010.
Update: We should not apply the cusomize xslt to ListXsltViewWebPart by UI in toolpane. We should open site by SPD, then change the property named "GhostedXslLink" is our customized xsl. This xsl is in layout/xsl folder of 14/hive. The content of this xsl file has reference to customized xslt.
Hope this help
Showing posts with label Access Denied. Show all posts
Showing posts with label Access Denied. Show all posts
Friday, October 14, 2011
Monday, February 14, 2011
"Access denied. Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
Contribute account can access and some actions on the page. I created a new page with inheritance from the default.master of SharePoint 2010.
I tested on SharePoint 2007 and as a result it works smoothly. But in SharePoint 2010, I got an error:
"Access denied. Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
The trace log:
It took me some hours to find out the problem, event thought I run the debugging line by line but it thows the exception before reach the CreateChildControl method. I guest it happens from ASPX or MasterPage.
Here is the problem:
Some resources of this MasterPage can not be accessed by Contributor account, so just remove them out. Hope this help you fix your issue.
I tested on SharePoint 2007 and as a result it works smoothly. But in SharePoint 2010, I got an error:
"Access denied. Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
The trace log:
It took me some hours to find out the problem, event thought I run the debugging line by line but it thows the exception before reach the CreateChildControl method. I guest it happens from ASPX or MasterPage.
Here is the problem:
Some resources of this MasterPage can not be accessed by Contributor account, so just remove them out. Hope this help you fix your issue.
Sunday, February 13, 2011
"Access denied" when using contributor account to access to content-type
When I was using the contributor account to check the content-type folder is "message" or "Dicussion", I got an error: "Access denied!"
My code:
if (ctype.ResourceFolder.Name == "Message")
{
//do something
}
But nothing happened with owner account.
Yes, because contributor account can not access to ResourceFolder properties of content-type. ResourceFolder was inherited from SPFolder and execute the method FolderEnsure. You know to give the access to folder ensure the account must be set the properties currentWeb.AllowUnsafeUpdates = true; and the default for member account does not have permission to run that update.
You can change the code to look like this:
if (ctype.Id == SPBuiltInContentTypeId.Message)
{
//do something
}
The result is nearly the same.
My code:
if (ctype.ResourceFolder.Name == "Message")
{
//do something
}
But nothing happened with owner account.
Yes, because contributor account can not access to ResourceFolder properties of content-type. ResourceFolder was inherited from SPFolder and execute the method FolderEnsure. You know to give the access to folder ensure the account must be set the properties currentWeb.AllowUnsafeUpdates = true; and the default for member account does not have permission to run that update.
You can change the code to look like this:
if (ctype.Id == SPBuiltInContentTypeId.Message)
{
//do something
}
The result is nearly the same.
Subscribe to:
Posts (Atom)