Access Rights and newslist control

Vote:
 
Hi, I want to apply access rights to news articles so that only members of certain groups can view the articles, but I want all users (including anonymous) to see the article title in the newslist but when clicked on they get a "You must be logged in/registered message" Any ideas? Cheers, Steve
#12525
Mar 25, 2008 18:35
Vote:
 
Well, it depends how you bind your newslist. One option is to use the GetChildren from the Datafactory class and set NoAccess as the last parameter like this: YourPreviewNewslist.DataSource = EPiServer.Global.EPDataFactory.GetChildren(Configuration.StartPage, EPiServer.Security.AccessControlList.NoAccess) If the user clicks on the newslink the logon screen will appear. Will this solve your request ? /Øyvind
#14430
Mar 25, 2008 18:44
Vote:
 
Thanks, but that won't solve my problem. What I want to do is show all news items/menulist items & unifiedFileSystem files irrespective of their security permissions but control what happens when an item is clicked on depending upon the security permissions. Regards, Steve
#14431
Mar 25, 2008 18:44
Vote:
 
OK. I've got this working with the unifiedFileSystem by using the unifiedDirectory (with the AccessControlList.NoAccess parameter) as the datasource for a datalist, but I can't get the newslist to work in the same way using the getchildren method with the AccessControlList.NoAccess parameter as the datasource. The newslist control isn't displayed at all if I don't set a value for PageLinkProperty, and when I do only articles that a user is authorised to are displayed. Any ideas? Regards, Steve
#14432
Mar 25, 2008 18:44
Vote:
 
You cannot use the PageLinkProperty at the same time you want to control the contents by using the GetChildren method. Set the list controls DataSource to the PageDataCollection you get from the GetChildren method and databind it. /Steve
#14433
Mar 25, 2008 18:44
Vote:
 
Steve, That's exactly what I did, but nothing in the newslist control was displayed, not header, footer, nothing. Is there anything obvious I might be doing wrong? Regards, Steve
#14434
Mar 25, 2008 18:44
Vote:
 
Problem solved. Schoolboy error I'm afraid. There was a typo in the pagelink in the code behind. Thanks for all you help. Steve.
#14435
Mar 25, 2008 18:44
* 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.