How to hide-show menu in wagtail CMS:
Here is my code on register_admin_menu_item hook inside blog/wagtail_hooks.py
    from wagtail.core import hooks
    from wagtail.admin.menu import MenuItem
    @hooks.register('register_admin_menu_item')
    def register_custom_admin_menu_item():
        return MenuItem(_('Site Admin'), reverse('admin_menu'), classnames='icon icon-folder-inverse',
         order=20000)
 
                        
For imposing the access on the menu, we can create the custom
MenuItemClass and override theis_shownmethod as below:Now use this
CustomAdminMenuIteminstead of MenuItem like:You can implement custom permission check also using
has_perminside is_shown like:For more details visit the source code here and doc here.