Implement multi-tenancy for an external custom plugin

Hi

I am developing my own external custom plugin in React.

I want to implement multi-tenancy for the same. I believe the process to first create namespaces for each company and then give access to users of a particular company to their namespace alone. Please correct me if wrong.

But I couldn't find any documentation related to controlling access or assigning namespaces to users or roles.

Kingly guide me

Thanks