Different menus for users

Hi!!

I'm creating my own theme with different useroptions, but after several workarounds for my needs I didn't find a solution for the following:

Hidden Gallery, only accessable with login.
User A, B and C (Admin)
User A < B < C
Some pages and albums

So user A should see Page 1, but User B shouldn't see and access it. But how can I solve this?

Is there a possibility to show custom menus depending of the user logged in? Or can I get the username wich is logged in (for a function)?

Need a custom menu for each user

Thank you for your help and great CMS.

Comments

  • acrylian Administrator, Developer
    You can unpublish menu entries. They follow the same rules as normal items: A user who has at least VIEW_ALL_RIGHTS will see them, all others don't. Seems besides that the menu_manager has no actual rights check on what to display. I guess we should add that …

    But if you really need entirely different menu sets you will have to code that on your theme. Either depending on the rights set to users using `zp_loggedin()` (see the user rights article) and/or checking for a specific user directly. Use the global variable `$_zp_current_admin_obj` which contains the object of the current user if any is loggedin.
  • Thanks, the unpublishing in combination with pages > "manage all" is a solution for my problem, as long as only two menu-states exists.

    And yes, some rights_management for the menu_manager would be great.

    Thanks again for your fast reply!
  • acrylian Administrator, Developer
    You can of course only manage a menu itself if you have admin rights. I think that should stay that way. But we will look into displaying only those menu items a visitor has rights to.

    This however in any case will only be applicable for menu entries of actual Zenphoto/Zenpage items and not for entries of custom links etc.
  • acrylian Administrator, Developer
    Quickly looked. The menu manager follows exactly this on the front end:
    http://www.zenphoto.org/news/an-overview-of-zenphoto-users#rules-of-protection-andvisibility-for-zenphoto-obj
    So with the right combination of managed and protected items and unpublishing you actually get what you wish.
Sign In or Register to comment.