title: Self-Made User Object, Wiring in the Templates
body: <p>Since I have to work on an existing database, I've written my own <code>User</code> type for my App. It works fine, but I have trouble wiring in the templates for it.</p>
  
  <p>The <a href="http://scala-tools.org/mvnsites/liftweb-2.4-M4/#net.liftweb.proto.ProtoUser" rel="nofollow"><code>ProtoUser</code> trait</a>, which I used, provides a lot of the functionality, even an own <code>sitemap</code> method. There's nothing wrong with that one, but I need it to be <a href="http://scala-tools.org/mvnsites/liftweb-2.4-M4/#net.liftweb.sitemap.Loc%24%24Hidden%24" rel="nofollow"><code>Hidden</code></a>.</p>
  
  <p>I've then tried to just make my own <code>Menu</code> instances for them. They are exactly like the ones defined in the <code>ProtoUser</code> trait, but they simply don't work.</p>
  
  <p>This is my current SiteMap. The full code is here <a href="https://github.com/scan/neighr-scala" rel="nofollow">here</a>.</p>
  
  <pre><code>    val entries = List(
        Menu.i("Home") / "index" &gt;&gt; Hidden,
        Menu.i("Branches") / "branches",
        Menu.i("Ponies") / "ponies",
        Menu.i("Profile") / "profile" &gt;&gt; If(() =&gt; User.loggedIn_?, "You must be logged in"),
  
  /*      Menu.i("Login") / "login" &gt;&gt; Hidden &gt;&gt; Template(() =&gt; User.wrapIt(User.login)) &gt;&gt; If(() =&gt; User.notLoggedIn_?, "Already logged in"),
          Menu.i("Logout") / "logout" &gt;&gt; Hidden &gt;&gt; Template(() =&gt; User.wrapIt(User.logout)) &gt;&gt; If(() =&gt; User.loggedIn_?, "You must be logged in"),
          Menu.i("Sign Up") / "signUp" &gt;&gt; Hidden  &gt;&gt; Template(() =&gt; User.wrapIt(User.signup)) &gt;&gt; If(() =&gt; User.notLoggedIn_?, "Already logged in"),*/
  
        Menu(Loc("Static", Link(List("static"), true, "/static/index"),
          "Static Content", Hidden))
      ) ::: User.sitemap
  </code></pre>
  
  <p>Maybe someone can help me on how to hide that <code>User.sitemap</code>? Or how it's supposed to be done, I am used to framework with explicit routing.</p>