Catalog Zone Manipulation

Last post 04-12-2007 10:24 AM by matt_cyr. 4 replies.

Sort Posts:

  • Catalog Zone Manipulation

    12-20-2006, 2:44 PM
    • Loading...
    • RDF
    • Joined on 03-07-2006, 2:13 PM
    • Posts 45

    I've got a page with webzones and webparts on it.  I'd like to add a catalog it the page to allow users to pick a set of webparts to put on the page.  The problem with the catalog is that is shows ALL available webparts to the user.  What if I wanted to limit which webparts a user can see?  Is there a way to itterate through the list of webparts that the webzone catalog retrieves and display only the ones I want?

     

  • Re: Catalog Zone Manipulation

    12-28-2006, 5:02 AM
    • Loading...
    • BCdotNET
    • Joined on 09-05-2006, 1:46 PM
    • Posts 38
    Read my post on this page: http://forums.asp.net/thread/1401652.aspx
    Life would be a lot easier if we could take a look at the source code.
  • Re: Catalog Zone Manipulation

    02-27-2007, 12:00 PM
    • Loading...
    • RDF
    • Joined on 03-07-2006, 2:13 PM
    • Posts 45

    While this explains a few things it does not address my situtation.  I am still looking for an answer on how to determine what webparts I want to show in the catalog zone.

  • Re: Catalog Zone Manipulation

    04-12-2007, 10:14 AM
    • Loading...
    • BCdotNET
    • Joined on 09-05-2006, 1:46 PM
    • Posts 38

    Look at the code in private void GetWebParts(), especially these lines:

    // retrieve the web parts from the database:
    List lMWP = GetMyWebParts();

    In my case, "GetMyWebParts()" retrieves a list from a Web Service, and because I use Kerberos I can determine in the Web Service which data I need to return, based on the user that connects to the WS.

    Life would be a lot easier if we could take a look at the source code.
  • Re: Catalog Zone Manipulation

    04-12-2007, 10:24 AM
    • Loading...
    • matt_cyr
    • Joined on 03-12-2007, 9:29 AM
    • Posts 85
    What about using the AuthorizationFilter of the webparts
    Then checking in the WebPartmanager's AuthrizeWebPart method

     
    Protected Sub WebPartManager1_AuthorizeWebPart(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WebParts.WebPartAuthorizationEventArgs) Handles WebPartManager1.AuthorizeWebPart
            Dim isAuthorized As Boolean = False
    
            If String.IsNullOrEmpty(e.AuthorizationFilter) Then
                e.IsAuthorized = True
                Return
            Else
                Dim roles As String() = e.AuthorizationFilter.Split(",")
                For i As Integer = 0 To roles.Length - 1
                    If HttpContext.Current.User.IsInRole(roles(i)) Then
                        e.IsAuthorized = True
                        Return
                    End If
                Next
            End If
    End Sub
     
Page 1 of 1 (5 items)
Microsoft Communities
Page view counter