Admin User Restrictions - Hide Menu items

Discussion in 'Customization & add-ons' started by halmaclean, Jul 14, 2016.

Thread Status:
Not open for further replies.
  1. halmaclean

    halmaclean aMember Pro Customer

    Joined:
    Aug 30, 2013
    Messages:
    50
    I am wondering if there is a way to hide things like the help and support block in the CP menu. We have a number of clients we set up with AM who are mistakenly using that thinking they are contacting us, and wonder why they see aMember information.

    I'd like to find a way through the admin permissions/restrictions to turn off that block in the same way as we can set what an admin user can actually see and do with the other blocks.

    Ideally (and in time) I'd also like to leave it turned on, but link it through to our own resources. For now though, simply turning off access to it would be most useful.

    Any ideas?
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    I am afraid there is not ability to control access to these items via admin permissions since these items do not require any specific permission. You can use simple code in site.php to remove it. Here you are
    http://www.amember.com/docs/Site.php_file
    PHP:
    Am_Di::getInstance()->hook->add(Am_Event::ADMIN_MENU, function (Am_Event $e) {
        
    $m $e->getMenu();
        if (
    $p $m->findOneById('help')) {
           
    $m->removePage($p);
        }
    });
    You can use same event to add your own menu items in future if necessary.

    Best Regards.
  3. halmaclean

    halmaclean aMember Pro Customer

    Joined:
    Aug 30, 2013
    Messages:
    50
    Thanks Caesar - I'll give it a go :)
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    You are welcome!
Thread Status:
Not open for further replies.

Share This Page