Any way to hide plugins from users who don't have permissions?

I found this old thread, but not really helpful.

How specifically does Kibana/OpenSearch decide whether or not to display the “Security” plugin in the nav bar? Is it possible to extend to functionality to other plugins? If anyone has any pointers I could look into maybe making changes and a pull request.