locked
CAS and Web Part RRS feed

  • Question

  • In what case i should use the CAS FOR WEBPART?
    Thursday, June 14, 2012 7:00 PM

Answers

  • Hi

    You would use CAS to restrict or increase the access that a Web part has to underlying systems. Typically if you need a web part to be stored in the bin directory you would need to elevate cas becaus it is set low by "default".

    Some links with more details here: http://msdn.microsoft.com/en-us/library/cc768613.aspx 

                                                       http://msdn.microsoft.com/en-us/library/cc768621.aspx

    Sandbox solutions have an ootb CAS policy


    Kind Regards Bjoern
    Blog


    • Edited by Bjoern H Rapp Thursday, June 14, 2012 7:21 PM
    • Marked as answer by SP10Dev Saturday, June 16, 2012 1:33 AM
    Thursday, June 14, 2012 7:21 PM
  • In general web parts created in Visual Studio 2010 are deployed to the GAC and are fully trusted so there is no need to get into CAS policies.  If you want to limit what a web part can do you would need to change the project to deploy the web part to the BIN directory and implement an appropriate CAS policiy.  But this is rarely done in SharePoint 2010.

    Paul Stork SharePoint Server
    MVP Senior Solutions Architect: BlueChip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    • Marked as answer by SP10Dev Saturday, June 16, 2012 1:33 AM
    Thursday, June 14, 2012 7:35 PM

All replies

  • Hi

    You would use CAS to restrict or increase the access that a Web part has to underlying systems. Typically if you need a web part to be stored in the bin directory you would need to elevate cas becaus it is set low by "default".

    Some links with more details here: http://msdn.microsoft.com/en-us/library/cc768613.aspx 

                                                       http://msdn.microsoft.com/en-us/library/cc768621.aspx

    Sandbox solutions have an ootb CAS policy


    Kind Regards Bjoern
    Blog


    • Edited by Bjoern H Rapp Thursday, June 14, 2012 7:21 PM
    • Marked as answer by SP10Dev Saturday, June 16, 2012 1:33 AM
    Thursday, June 14, 2012 7:21 PM
  • In general web parts created in Visual Studio 2010 are deployed to the GAC and are fully trusted so there is no need to get into CAS policies.  If you want to limit what a web part can do you would need to change the project to deploy the web part to the BIN directory and implement an appropriate CAS policiy.  But this is rarely done in SharePoint 2010.

    Paul Stork SharePoint Server
    MVP Senior Solutions Architect: BlueChip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

    • Marked as answer by SP10Dev Saturday, June 16, 2012 1:33 AM
    Thursday, June 14, 2012 7:35 PM