HELP: How to moderate individual web part

Last post 05-09-2008 5:29 AM by Ngala. 2 replies.

Sort Posts:

  • HELP: How to moderate individual web part

    05-09-2008, 3:35 AM
    • Loading...
    • Ngala
    • Joined on 05-09-2008, 3:31 AM
    • Posts 2

    Hi

    I can see how to make changes to a web part and then have the entire page be approved by a user.
    I want to know.. if there are 4 parts on a page and I want a user to approve only parts that they are authorized for, how would I go about doing that?

    Thanks
    NGala

    Filed under:
  • Re: HELP: How to moderate individual web part

    05-09-2008, 5:23 AM
    • Loading...
    • vinz
    • Joined on 10-05-2007, 11:47 AM
    • Cebu Philippines
    • Posts 6,026

    You can apply WebPart Personalization per Roles using User.IsInRole() method... see below

    public void Page_Load()
    {
        if( !Context.User.IsInRole("administrator") )
        WebPartManager.Current.WebParts[0].AllowClose=false;

    Or this below
     

        if (User.IsInRole("Administrators")) {
            WebPartManager1.DisplayMode = WebPartManager.EditDisplayMode();
            WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode();
        }
        else if (User.IsInRole("NormalUsers")) {
            WebPartManager1.DisplayMode = WebPartManager.BrowseDisplayMode();
        }
        else {
            Response.Write("Invalid user");
        }

    More information then check this

    http://support.microsoft.com/kb/306590

    Or if you wanted to show/hide a certain WebPart on the Page per User Level then you can refer to this link below 

    http://normen.mine.nu/MyBlog/viewpost.aspx?PostID=90 

     

    Cheers,
    Vincent Maverick Durano


  • Re: HELP: How to moderate individual web part

    05-09-2008, 5:29 AM
    • Loading...
    • Ngala
    • Joined on 05-09-2008, 3:31 AM
    • Posts 2

    HI

    Thanks, but this was more about approving a revision. So if UserA logs in and creates a revision to webpart1 and webpart2 and then Admin1 only has rights to approve webpart1.. how do I approve and sync just one web part vs. the entire page.

     -Nikisha

Page 1 of 1 (3 items)