Zend certified PHP/Magento developer

How to hide a category in the top menu programmatically in Magento 2?

I know that Enterprise Edition meets the requirement. What I want is to show the category “Wholesale” just to my customer group in “Wholesale”.

When a customer is logged in and he is in this group, he is able to see the category.

I know all the validations

if (!($this->_customerSession->isLoggedIn() && $this->_customerSession->getCustomer()->getGroupId() == 2)) {
    // hide category
}

The part that I haven’t reached is where I have to write this code.