Permission Denied to Reader Level Users
I built a custom webpart that reads a the Weather Channel's xml feed and applies a local XSL stylesheet to it. The web part works great except for any reader level users. When I put the webpart on a webpage, any user who only has reader level rights
gets sent to /_layouts/AccessDenied.aspx. I've checked the log files and I cannot figure out what is causing the permission error.
I thought perhaps the issue was because of some image being used, but when I downloaded the XML feed from the Weather Channel and then put it into an XML web part and then put the text of the XSL document there as well, the web part rendered correctly. So
that leads me to believe the issue is related to the C# code.
In my code, I'm using an xmlreader object to read the xml and then transforming the xml using the referenced xsl document.
I've checked the log files both in the 12 hive and the logfiles directory and don't really see anything that sticks out.
My questions for you are:
What code cause my reader level users to get access denied but all my other users work fine?
Where else can I check to find out exactly what is being denied?
May 7th, 2010 11:03pm
It's in a document library to which they have access. I've confirmed that the readers can access the xsl document and all the images that are loaded, which are in a folder on the server.
Free Windows Admin Tool Kit Click here and download it now
May 8th, 2010 1:15am
I fixed the problem by changing the code. I found that the error was caused by this line of code:
SPFile file = web.Folders[xslLibrary].Files[xslFileName];
Where xslLibrary was the name of the document library storing the xsl file and xslFileName was the name of the xsl file itself.
I changed the code to read like this:
SPFile file = web.GetFile(xslSrc);
Where xslSource is the URL of the xsl documenent relative to the website (/xsllibrary/xslfile.xsl)
May 12th, 2010 12:19am