+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / Upgraded to SP4 "All Pages" view shows all pages including restricted to the user.

Upgraded to SP4 "All Pages" view shows all pages including restricted to the user.

4 posts, 1 answered
  1. Che
    Che avatar
    6 posts
    Registered:
    21 Apr 2008
    20 Dec 2010
    Link to this post

    After upgrading Community from 3.7 SP2 to SP4, “All Pages” view in Pages module shows all pages regardless of permissions users have to view pages. Selecting a restricted page would generate “You have no permissions to view this page” but listing all of them for all users still doesn’t seem right. I could probably filter pages by adding OnDataBound event handler but I would appreciate you helping me with fixing the view without adding a code.

    Thank you.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    20 Dec 2010
    Link to this post
    Hello Che,

    For the SP3 we improved the performance of the Dashboard and GridView control that shows all pages.This behavior is by design since Sitefinity 3.7 SP3. To get good loading times for the pages section we had to drop the permissions check when populating the pages grid.In the TreeView on the left users see only the pages for which they have permissions. There they can browse and edit only the pages for which they have rights. In the Grid on the center of the page users see all pages, even the ones for which they do not have permissions.  Thus they can easily browse through all pages. We have added search to enable easy access to a page.

    You could hack the pages grid and disable the rows for the users that does not have View permissions as shown below

    sample

    void GridView1_PreRender(object sender, EventArgs e)
       {
           foreach (GridViewRow r in GridView1.Rows)
           {
               var link = ((System.Web.UI.WebControls.HyperLink)(r.Cells[1].Controls[1])).NavigateUrl;
               var l = link.IndexOf("select");
               var s = link.Substring(l + 7, 36);
               Guid pageId = new Guid(s);
               var cmsManager = new Telerik.Cms.CmsManager();
               var p = (Telerik.Cms.ICmsPage)cmsManager.GetPage(pageId);
               Telerik.Cms.Security.PagePermission perm = new Telerik.Cms.Security.PagePermission(p);
               if (perm.CheckDemand(Telerik.Security.Permissions.CrudRights.View))
               {
                   r.Enabled = false;
               }
               else
               {
      
               }
      
           }
       }

    this should be done in Sitefinity\Admin\ControlTemplates\Pages\AllPagesList.ascx. Each loop is for 20 items - the number of the pages set for the GridView.


    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  3. Che
    Che avatar
    6 posts
    Registered:
    21 Apr 2008
    21 Dec 2010
    Link to this post

    Hi Ivan,

    Thanks for the explanation and I fully understand reasons behind your decision but I still would like to hide existing page names and paths from those who are not supposed to see them. Your solution works and allows to hide pages, however as you’ve mentioned, filtering works only for the current page so to show all available pages at once I have to disable paging (or rather set page size to some big number). I’m wondering if it is possible to hide AllPages in a TreeView and redirect user to the first available for him node instead?

    Thank you again!

  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    21 Dec 2010
    Link to this post
    Hi Che,

    You can create a custom RadTreeView and replace the default one or subscribe for NodeDataBound event of the RadTreeView and make some modifications to it

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
4 posts, 1 answered