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

Forums / Bugs & Issues / Telerik.Sitefinity.Model was not granted View in Pages for principals with IDs 00000000

Telerik.Sitefinity.Model was not granted View in Pages for principals with IDs 00000000

8 posts, 0 answered
  1. Enrique Coronel
    Enrique Coronel avatar
    17 posts
    Registered:
    10 Jul 2008
    23 Feb 2011
    Link to this post
    Hi, actually i use a radRotator control in the home page, and when i'm using hyperlinks this error appeare.

    Telerik.Sitefinity.Pages.Model.PageNode, Telerik.Sitefinity.Model was not granted View in Pages for principals with IDs 00000000-0000-0000-0000-000000000000


    Any suggestion?

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    01 Mar 2011
    Link to this post
    Hello Luis Enrique,

    Can you please make sure that you are querying the pages for the front end only? It looks that you are trying to query for all pages and the API call is failing due to insufficient permissions (seems like an anonymous user).

    Best wishes,
    Radoslav Georgiev
    the Telerik team
  3. des white
    des white avatar
    2 posts
    Registered:
    25 Sep 2009
    08 Mar 2011
    Link to this post
    I'm getting exactely the same error. I opened a support ticket and heres the answer I got from Ivan.

    "You have a custom control that works with pages - NewsRotator.ascx.cs. In this control you are using the API to get the pages, but the anonymous user does not have view permission on some of the pages and this results in an error. Generally you query all pages, so you need to grant view to the anonymous user for all pages."

    Sounds great but theres not instructions on how to set these permissions. Ive tried going to the Administration menu in sitefinity and setting Global Permissions and added the Anonymous user to have 'view permissions' however this still does not work.

  4. Bruno Michels
    Bruno Michels avatar
    125 posts
    Registered:
    16 Apr 2010
    14 Mar 2011
    Link to this post
    How do I get front pages only to avoid this permission issue?
  5. des white
    des white avatar
    2 posts
    Registered:
    25 Sep 2009
    14 Mar 2011
    Link to this post
    Hi Bruno,

    For me it was the lambada expression that needed to be referencing the front end.
    The highlighted text is the additional expression that resolved my issue.

    this.targetNewsPage = App.Prepare(settings).WorkWith().Pages().LocatedIn(Telerik.Sitefinity.Fluent.Pages.PageLocation.Frontend)
                .Where(p => p.Page != null &&
                            p.Page.Controls.Where(c => c.ObjectType.StartsWith(typeof(NewsView).FullName)).Count() > 0)
                .Get().FirstOrDefault();

    I hope this help.

  6. Abhilash Shamsunder
    Abhilash Shamsunder avatar
    10 posts
    Registered:
    05 Apr 2010
    13 Feb 2013 in reply to des white
    Link to this post
    This works. Thanks..
  7. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    23 May 2013 in reply to des white
    Link to this post
    Would this work if some of your front end pages where restricted by role/group?
  8. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    06 Dec 2016
    28 May 2013
    Link to this post
    Hello,

    Yes, it should work. Depending on your specific project settings the query will automatically exclude the pages that the current user does not have view permissions for.

    By default Sitefinity has the view permissions check disabled, as this brings additional performance benefit when querying each item.

    However you can achieve the desired functionality by enabling the FilterQueriesByViewPermissions parameter in our Security configuration, by going to Administration ->Settings -> Advanced -> Security.

    When this filter is enabled, by default all API calls, like the one you have given as an example, will be filtered, and the returned results of the query will be only the ones that the current user has the permissions to view.

    For more information about the FilterQueriesByViewPermissions setting you can also check this KB article form our Knowledge base, hope you find it useful


    Regards,
    Boyan Barnev
    Telerik
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
8 posts, 0 answered