Anonymous Access and Publishing Web Pages List
As You know, using PublishingWeb.GetPublishingWeb(web) method causes Access Denied exception for anonymous users. You will also get the same exception if you try to access the PublishingWeb.GetPagesListId(web) or PublishingWeb.GetPagesListName(web) methods.
There are solutions here and here and in many other blogs. These solutions use SPSecurity.RunWithElevatedPrivileges, but that’s not ideal solution for anonymous sites.
So how to get pages list from a web, if you don’t even know if the web is publishing site and you are not able to use PublishingWeb.IsPublishingWeb(web)?
Heres yet another solution. Open the web you want to check if it is a publishing site and try to get the pages list using TryGetList method with the right localized pages list name. You will get the localized name from cmscore.resx file using SPUtility.GetLocalizedString method with resource key “List_Pages_UrlName”.
string.Format("$Resources:{0}", "List_Pages_UrlName"),
"cmscore", web.Language));
if (pages != null)
{
// do the do
}
It all gets interesting, if the site is not publishing web, but still contain a list called “Pages”. Then You might want to check another things from returned list, not just if it’s null like in the snippet above.
***********************************************
Jerry Seinfeld: Why not? We’re neighbors. What’s mine is yours.
Cosmo Kramer: [leaning against the door-frame and looking around in wonder] Really?
***********************************************
Popularity: 1% [?]
Thanks, I needed this today and knew where to look for a solution.
http://www.sharepointblues.com/2012/12/19/alternative-for-publishingweb-ispublishingweb/
This is definitely amazing, You will be a extremely specialized digg. I’ve got become a member of the rss and search in advance for you to trying to find a greater portion of a person’s superb write-up. Also, We’ve provided your web blog during my internet sites
This article offers clear idea in favor of the new users of blogging, that truly how to do blogging.|
Hi buddy i agree with you. nice work! https://www.procarpetcleaningorlando.com/drphillips
Great!! thank you for sharing this information.
The problem is that it should work as a “talk to us” page and just for this purpose that I wanted to enable anonymous access, to let a huge number of users access it. I guess the properly solution would be making the entire public site “Online”, so those anonymous users could access this specific page.
More valuable informations about free sexy chat with hot ladies only at sex mitoma
Visit sextreffen lübeck and chat with hot ladies all night long
When I open your RSS feed it seems to be a bunch of strange characters, is the malfunction on my reader?
TY, great job! Exactly the stuff I had to know.
Hey cool blog, just wondering what anti-spam software program you use for comments as a result of i get heaps on my blog. Anyway, in my language, there usually are not a lot good source like this.
This is very brilliant! I can really use this info for my current work. Thanks for sharing this!
This is just fantastic! I’ll be able to put this information to good use in my current job. Thank you so much for sharing this!
This is awesome and is a big help as well for our projects, thank you for sharing this!
Transexuelle á Rennes is fine web place for casual sexy chat contacts with hot ladies in France
Shemale Linz is web platform for casual contacts and sexy chat with hot shemales in EU
Glad to know this information. Thanks for sharing! http://www.ohiosignaturepainting.com
This is a great read. Thanks!
I never knew it is possible.
https://www.landscaping-santaclarita.com/
Transexuel Sex Bordeaux is the best web place for finding casual contacts in France
Enjoy sexy contacts with fine ladies in EU only at sex winterthur
I appreciate you sharing this post! Thank you very much.
What an excellent post. Keep sharing! New Yukon
Such a nice read. Thanks for sharing! New Yukon
This is nice, thanks for sharing this https://www.stlouisgutterspecialists.com/