Page permissions problems

Vote:
 
I'm experiencing som problems with page permissions in EPiServer 4.61. Suddenly, users that aren't logged in cannot access some pages, even though "Everyone" has read permissions. This seems to affect only a particular subtree in the structure, and not quite all of the pages. GetChildren() returns empty collections, and GetPage(id) redirects me to the login screen. If I change the permissions so that Everyone also has change permissions, the pages are returned by GetChildren and GetPage as I expect. If anyone has an idea what is causing this I would be very grateful. If it makes any difference it seems to have started when I turned on "Friendly" URLs. I have turned them off again and it still doesn't work, so I don't know if there's a connection...
#12793
Mar 25, 2008 18:35
Vote:
 
There's some authentication built into the method GetPage(). Try using Global.EPDataFactory.GetPage(pageref, EPiServer.Security.AccessControlList.NoAccess);
#14908
Mar 25, 2008 18:46
Vote:
 
I could do that, but then I still wouldn't know what the problem is. I want to know why anonymous users don't have access.
#14909
Mar 25, 2008 18:46
Vote:
 
And a brief update: I tried creating a user with no group memberships and access to functions to see the error message. I got the error "Access denied to page ". If i set change access to the user, the page displays, but no child pages are listed.
#14910
Mar 25, 2008 18:46
Vote:
 
Hi, The error is probably due to the fact that you are referencing a restricted page from the main page they are trying to access. When it happened to me, it was because a page in the recycle bin was being referenced. Do you have any PageLists on the page? Check carefully all the links to the page. The error is probably happening when trying to get a link to the target page. I use a function like this to generate my links: public static String GetListDataLink(Object link) { // If we have no reference, return an error if (link == null) { // Return an error link return "javascript:alert('No target specified - select a Link Page.');"; } PageReference p = (PageReference) link; // Page bypassing security PageData pd = Global.EPDataFactory.GetPage( p, AccessControlList.NoAccess ); // Check the access if ( (pd.QueryAccess() & AccessLevel.Read) == AccessLevel.Read) { return DLSIPageLink(pd); } else { // Return an error link return "javascript:alert('You do not have access to see the target page (" + pd.PageName + " [" + p.ID + "])');"; } } Hope this helps Jon
#14911
Mar 25, 2008 18:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.