incubator-esme-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From esjew...@apache.org
Subject svn commit: r988561 - /incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala
Date Tue, 24 Aug 2010 14:24:16 GMT
Author: esjewett
Date: Tue Aug 24 14:24:15 2010
New Revision: 988561

URL: http://svn.apache.org/viewvc?rev=988561&view=rev
Log:
[ESME-260] Fixes issue with protection of user, tag, contacts, and public timeline pages

Modified:
    incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala

Modified: incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala
URL: http://svn.apache.org/viewvc/incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala?rev=988561&r1=988560&r2=988561&view=diff
==============================================================================
--- incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala (original)
+++ incubator/esme/trunk/server/src/main/scala/bootstrap/liftweb/Boot.scala Tue Aug 24 14:24:15
2010
@@ -158,16 +158,19 @@ class Boot {
     // Register Auth methods that are used in ESME
     
     UserAuth.register(UserPwdAuthModule)
-    UserAuth.register(OpenIDAuthModule)
+    UserAuth.register(OpenIDAuthModule)  
+                      
+    def ifIsLoggedIn = If(User.loggedIn_? _, strFuncToFailMsg(() => S.?("base_error_not_logged_in")))
 
     // Build SiteMap
     val entries = Menu(Loc("Home", List("index"), "Home")) ::
-        Menu(Loc("user", List("info_view", "user"), "User Info", Hidden,
+        Menu(Loc("user", List("info_view", "user"), "User Info", ifIsLoggedIn,
           Loc.Snippet("user_info", TagDisplay.userInfo))) ::
         logLevel.menu  ::
-        Menu(Loc("tag", List("info_view", "tag"), "Tag", Hidden, Loc.Snippet("tag_display",
TagDisplay.display))) ::
-        Menu(Loc("public", List("info_view", "public"), S.?("base_profile_public"))) ::
-        Menu(Loc("contacts", List("info_view", "contacts"), S.?("base_profile_contacts")))
::
+        Menu(Loc("tag", List("info_view", "tag"), "Tag", ifIsLoggedIn,
+          Loc.Snippet("tag_display", TagDisplay.display))) ::
+        Menu(Loc("public", List("info_view", "public"), S.?("base_profile_public"), ifIsLoggedIn))
::
+        Menu(Loc("contacts", List("info_view", "contacts"), S.?("base_profile_contacts"),
ifIsLoggedIn)) ::
         Menu(Loc("sign_up", List("signup"), S.?("base_menu_signup"),
           Snippet("signup", User.signupForm),
           Unless(User.loggedIn_? _, S.?("base_menu_sign_up_error")))) ::



Mime
View raw message