In out PocketChange app:
http://github.com/tjweir/pocketchangeapp/tree/master
The only thing we do in Boot is append the user Menus (User.siteMap) for
SiteMap:
LiftRules.setSiteMap(SiteMap(MenuInfo.menu :_*))
...
object MenuInfo {
import Loc._
val IfLoggedIn = If(() => User.currentUser.isDefined, "You must be logged in")
def menu: List[Menu] = Menu(Loc("home", List("index"), "Home")) ::
Menu(Loc("manageAccts", List("manage"), "Manage Accounts", IfLoggedIn)) ::
Menu(Loc("addAcct", List("editAcct"), "Add Account", Hidden, IfLoggedIn)) ::
Menu(Loc("viewAcct", List("viewAcct") -> true, "View Account",
Hidden, IfLoggedIn)) ::
User.sitemap
}
IIRC, the User sitemap stuff is new and handles the rewrite stuff.
Derek
On Sat, Mar 14, 2009 at 8:09 AM, Josh Suereth <[email protected]>wrote:
> Hi lift community! I'm ugprading a lift application that I was not the
> author of and am trying to figure out what changes I need to make. here's
> my current state of brokenness (all in boot.scala)->
>
>
> S.addAround(User.requestLoans)
>
>
> LiftRules.rewrite.prepend {
> case Req("login" :: Nil,_,_) =>
> Login.login //This is the only Req
> pattern match I've fixed so far, I still don't know what happened to the
> Login object
> case Req(_, ParsePath("logout" :: Nil, _, _), _, _) => Login.logout
> case Req(r, _, _, _) if r.uri.endsWith("/home/index") =>
> ignore => Full(RedirectResponse("/"))
>
> case Req(r, ParsePath("attendees.txt" :: Nil, _, _), _, _) if
> User.superUser_? =>
> ignore => Full(User.attendees)
>
> case Req(r, ParsePath("redirect_to" :: "edit" :: which :: page :: _,
> _, _), _, _) =>
> ignore => Full(RedirectResponse("/"+which+"/edit/"+page))
>
> case Req(r, ParsePath("go" :: "home" :: _, _, _), _, _) =>
> ignore => Full(RedirectResponse("/"))
> }
>
>
> The application appears to not be using the menu system (but I haven't dug
> in too thoroughly). My question is, where did all this Login/User stuff
> go? I'm using the MetaMegaProtoUser magic, so I'm a bit out of my element
> here.
>
> Anyway, if someone could help me out with what happened User.requestLoans
> and the Login object, I would highly appreciate!
>
>
> -Josh
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---