magento2 – magento 2. How to hide the button & # 39; Add to cart & # 39; while not connected

This is how I tried but it does not work.
"Bodak / DisableAddToCart / etc / adminhtml / system.xml"

    

    
        
Magento Config Model Config Source Yesno

Then in "Bodak / DisableAddToCart / etc / di.xml"



    
        
    

Then, after that, "Bodak / DisableAddToCart / Plugin / IsSalablePlugin.php"

scopeConfig = $ scopeConfig;
$ this-> context = $ context;
}

/ **
* Check if it is disabled to add to the cart and if the client is connected
*
* @return bool
* /
public function afterIsSalable (): bool
{
$ scope = ScopeInterface :: SCOPE_STORE;

if ($ this-> scopeConfig-> getValue (self :: DISABLE_ADD_TO_CART, $ scope)) {
if ($ this-> context-> getValue (CustomerContext :: CONTEXT_AUTH)) {
true returns
}
false return;
}
true returns
}
}