November Happy Hour will be moved to Thursday December 5th.

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
Feb 17, 2006 15:10
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
Feb 20, 2006 13:54
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
Feb 21, 2006 12:08
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
Feb 28, 2006 16:45
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
Feb 28, 2006 19:40
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 01, 2006 10:24
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 01, 2006 10:50
* 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.