Bezpečnost Web Parts
*Bezpečnost kontrolována pomocí CAS
l
*
*
*
*
*Nastavení bezpečnosti
*OSVR_Minimal (výchozí pro Office Server)
*WSS_Minimum (výchozí pro WSS V3)
*WSS_Medium
*Full
<!– web.config in root directory of hosting virtual server -->
<configuration>
  </system.web>
 
    <!-- <trust level="WSS_Minimal" originUrl="" /> -->
    <trust level="Full" originUrl="" />
  </system.web>
</configuration>
Instructor Notes
After discussing SafeControl entries, it's important to also mention that each web.config file contains a trust element that configures a sandbox for Web Part DLLs running inside the \bin directory. It's probably not a good idea in most classes to go to deeply into the topic of Code Access Security (CAS) which is the underlying technology used to enforce the sandbox.

However students should realize that Web Part DLLs in the bin directory run inside a very restrictive sandbox by default because the trust level setting is either WSS_Minimum or OSVR_Minimum depending on whether you have installed just WSS or Microsoft Office SharePoint Server 2007. That means code inside a Web Part cannot read files from the local files system, connect to SQL Server or program against the WSS object model. You can change this by changing the level setting to WSS_Medium, saving the web.config file and running a IISRESET.

To remove the sandbox completely, change the level setting to Full. save the web.config file and run IIS reset.

Finally, point out that the trust level only affect Web Part DLLs inside the \bin directory of the hosting WSS Web application. Web Part DLLs loaded from the Global Assembly Cache always run with full trust.