It seems that the best way to set the redirect location is using the LiftRules object, for example:
LiftRules.siteMapFailRedirectLocation = "user_mgt" :: "login" :: Nil I hope this helps, Ben On Jul 3, 11:39 am, Ewan <ehar...@gmail.com> wrote: > I wonder if anyone would care to advise of the most appropriate > solution for not rendering sitemap menu items with additional redirect > to a login page. I have read a couple of solutions in this list but > here is what I have done cobbled together from the liftbook. > > I have an If LocParam for testing if a user is logged in which is > added to a menu: > > val loggedInLocParam = If(() => User.loggedIn_?, > () => RedirectWithState("/user_mgt/login", > RedirectState(Empty, ("You must login", NoticeType.Notice)))) > > this seems to achieve the effect I am looking for in that the menuitem > is not rendered and if the url was bookmarked and the user tries a GET > then they are redirected to login and a notice is added and rendered > at the top of the page accordingly. > > Is this a good solution or can this cat be skinned better? I have > read something about Loc.EarlyResponse and was hoping for an > explanation. > > --Ewan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---