To enable that, you need to overwrite the
availableForNavigationstatic method, as following.
As you can see, what I did basically to check if there is static permission property, I will use that to check with Spatie permission.
You may apply your own logic to control the sidebar display.
Hopes that help you in more flexible way to control your sidebar.