Jump to content
Software FX Community

Error Rendering Chart on a Share point webpart.


riazpagarkar

Recommended Posts

I have developed a webpart library in which I have rendered a chart control. The code and steps are similar to the article from softwarefx.

URL: http://support.softwarefx.com/ShowArticle.aspx?Type=KB&Product=CfxNet70&Source=http://support.softwarefx.com/kb/750/1/012.htm?_r=1

The chart render for administrator account. But for not administrator it is displaying error.

403 unauthorized access.

 I then created a custom security policy to give full trust.

<securityPolicy>

  <trustLevel name="WSS_Medium" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_mediumtrust.config" />

  <trustLevel name="WSS_Minimal" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_minimaltrust.config" />

  <trustLevel name="CustomFullTrust" policyFile="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\CustomFullTrust.config" />

  </securityPolicy>

<trust level="CustomFullTrust" originUrl="" />

I assigned the Full trust for the webpart library and the chart fx dlls.

The CustomFullTrust.config is like follows

<CodeGroup

  class="FirstMatchCodeGroup"

  version="1"

  PermissionSetName="Nothing">

  <IMembershipCondition

  class="AllMembershipCondition"

  version="1"

  />

 <CodeGroup

  class="UnionCodeGroup"

  version="1"

  PermissionSetName="FullTrust"

  Name="Web Part Library"

  Description="This code group grants code signed with the Microsoft strong name full trust. ">

  <IMembershipCondition

  class="StrongNameMembershipCondition"

  version="1"

 PublicKeyBlob="0024000004800000940000000602000000240000525341310004000001000100b7ba87418766147131c36dc6e649a423be465db322b78c3464c7e1e2bcf402adaf2c00e1ca495b6d204d4e98e9c31114a962096596459cc5d09e1c7b9a81da8356bfd582dafb9d51f753d1ef8d569038c5f8ebe7b720213ff30b48f7dd33e00937acb8db13d8c486e6ddfede9703561fd72388c5e712a1562b8e184579e391ad"

  />

  </CodeGroup>

 <CodeGroup

  class="UnionCodeGroup"

  version="1"

  PermissionSetName="FullTrust"

  Name="ChartFX"

  Description="This code group grants code signed with the Microsoft strong name full trust. ">

  <IMembershipCondition

  class="StrongNameMembershipCondition"

  version="1"

 PublicKeyBlob="00240000048000009400000006020000002400005253413100040000010001003d35b05ac523a5dbbdb65b6158a5de0eb20d2519ff6956ae294fcada2ca2d354428a1163f56e8294c277132ba0759d85b87df88169b63f8519882738bba48b91260f3e090252de6da366e8f16ee32b4c816cd9f6a466232d57e55bb92cae3e4a6e01b4c0b41241819d25d5dcbf6f1cddb0b7abbae608cb541106e8855f0bceb6"

  />

  </CodeGroup>

 I also addded them as safe in the portal webconfig. But still I am facing the problem.

I noticed that creating the control in memory and assigning properties are not throwing the error it is coming from one statement in the code

this.Controls.Add(chtxData); where the control is loaded in the webparts  CreateChildControls() process.

Just guessing (I think the error lies in temporary creating the image of the chart and the folder permissions are needed on some temporary folder where the chart image is first created)

Can some one help me on this

Link to comment
Share on other sites

This error seems not to be a Chart FX related issue, but rather created by permission settings in SharePointPermission.I Google it and I found this link http://www.katriendg.com/aboutdotnet/2007-6-webresources-webpart-403-forbidden.aspx<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

"To resolve this I tried adding Read permissions to the IUSR_computername and the ASPNET users to the /bin directory of my web application. This solved the problem but is not a solution I can use on a production environment. Every time a new SharePoint solution is deployed to the web application the file permissions on the bin directory are reset by SharePoint anyway 

Using this in combination with the Impersonate="true" in the SharePointPermission in CAS does it! Not setting the impersonation will raise a security exception when calling RunWithElevatedPrivileges."

I hope it helps.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...