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
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
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
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
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
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