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

Forums / General Discussions / SecurityDemandFailException

SecurityDemandFailException

4 posts, 0 answered
  1. Jon
    Jon avatar
    41 posts
    Registered:
    20 Oct 2010
    20 Jan 2011
    Link to this post
    This piece of code use to work however, now i get this error in my SiteFinity project ..

    var pgs = App.WorkWith().Pages().Where(pk => pk.Name == root).Get().SingleOrDefault() as PageNode;

    Error : SecurityDemandFailException

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

    I'm not sure why the code is not working anymore

    Thanks in advance.
    Jon
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jan 2011
    Link to this post
    Hello Jon,

    The anonymous user does not have permissions to see the page you are trying to get. This is why you get this error. The user you use ( or anonymous)  should have view permissions over this page.

    Kind regards,
    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
  3. Jon
    Jon avatar
    41 posts
    Registered:
    20 Oct 2010
    20 Jan 2011
    Link to this post
    All the pages in SiteFinity have permissions set at 'everyone' already. Could it possibly be something else ? Can you try the code yourself in the latest release of SiteFinity ? I'm not sure whats going on here . Any other ideas ?

    Regards.
    Jon
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Jan 2011
    Link to this post
    Hi Jon,

    If I have "View" permissions the code below works fine. You can try this by authenticating yourself with an administrator and then executing the code.

    Regards,
    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
4 posts, 0 answered