Ask a questionAsk a question
 

QuestionWSS3 hide web part if permissions don't exist

  • Tuesday, July 31, 2007 8:15 PMJasonD240 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I have several web part pages that managers will be using as a company dashboard. The problem that I have is that instead of just not showing up to read only users, the web parts show an access denied error. Is there a way to simply hide the web part if the user does not have the appropriate user permissions?

     

    I am using Sharepoint Services 3.

     

    Any suggestions are appreciated, thanks,

     

    Jason

All Replies

  • Wednesday, August 01, 2007 8:47 PMRich McGuire Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I know Audiences themselves don't exist in WSS 3, but you might still be able to apply audience filtering on Web Parts w/ SharePoint groups (done by modifying the properties of the web part)

  • Friday, August 03, 2007 7:19 AMSuchii _www.bewise.fr_MVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi,

     

    I've developped a WebControl able to hide unauthorized WebPart. You can download it from http://www.bewise.fr/download/toolbox/Bewise.SharePoint.RoleViewerManager.zip

     

    The .zip file contains a "Read Me.txt" explaining how to install it.

     

     

    Laurent Cotton (Aka Suchii)

    MCTS / MCSD.NET / MCT

    www.bewise.fr

    blog : http://sharepoint.over-blog.fr/

     

  • Friday, August 03, 2007 3:10 PMJasonD240 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hi Suchii,

     

    Thank you for the file. I attempted to use GACUtil to import the dll however it failed citing an unknown error. Any suggestions?

     

    Thanks,


    Jason

  • Friday, July 03, 2009 8:39 PMgrigb Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello Suchii,

    I’ve tried to download your WebPart and I can not succeed.

    The link is not more available.

    Can you tell me where has been moved?

    Thank you,

    Gregoire

  • Monday, July 06, 2009 2:50 PMKyle Schaeffer Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Jason, as an alternative, you could also add a "SPSecurityTrimmedControl" around  a special web part zone on your page layout(s).  You'll want to create a web part zone on your page layouts that looks something like this:

    <SharePoint:SPSecurityTrimmedControl PermissionsString="ManagePermissions" runat="server">
         <WebPartPages:WebPartZone id="zone1" runat="server" title="Top Zone" />
    </SharePoint:SPSecurityTrimmedControl>
    
    In this example, I have a web part zone inside the security-trimming control that only allows users with the "ManagePermissions" permission-level to see any web parts within that web part zone.  This is an OOTB fix that should be relatively easy to implement.

    You can read more about the different permission levels you can use here:  http://codename-srini.blogspot.com/2009/04/spsecuritytrimmedcontrol-and.html


    Kyle