Say you have a response.menu, that goes

response.menu = [
    (T('Home'), False, URL('default','index'), [
      (T('Looged In stuff'), False, URL('default','index'))
    ]),
    (T('Logged in menu'), False, URL('default','index'), [
      (T('Menu Item'), False, URL('default','index'))
    ])
   ]

In this menu, some of the items, are for logged in users only. In the
new trunk, you can add a boolean statment, like true or false to the
menu, to hide a menu item. This can be used the following way:

response.menu = [
    (T('Home'), False, URL('default','index'), [
      (T('Some other stuff'), False, URL('default','index')),

      (T('Looged In stuff'), False, URL('default','index'), [],
auth.is_logged_in())
    ]),
    (T('Logged in menu'), False, URL('default','index'), [
      (T('Menu Item'), False, URL('default','index'))
    ], auth.is_logged_in())
    ]

You can ofcourse use every other boolean statement to make items
appear of disappear from this menu.
Hope you'll find this useful

Yair Eshel Cahansky

Reply via email to