Telerik.Sitefinity.Model was not granted View in Pages for p

Posted by Community Admin on 04-Aug-2018 01:43

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

All Replies

Posted by Community Admin on 23-Feb-2011 00:00

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?

Posted by Community Admin on 01-Mar-2011 00:00

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

Posted by Community Admin on 08-Mar-2011 00:00

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.

Posted by Community Admin on 14-Mar-2011 00:00

How do I get front pages only to avoid this permission issue?

Posted by Community Admin on 14-Mar-2011 00:00

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.

Posted by Community Admin on 13-Feb-2013 00:00

This works. Thanks..

Posted by Community Admin on 23-May-2013 00:00

Would this work if some of your front end pages where restricted by role/group?

Posted by Community Admin on 28-May-2013 00:00

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

This thread is closed