Hi,
I want some suggestion regarding my SaaS app that I am building.
Requirements are as follows.
Main App:
Companies are registered in our platform.
Company has many employees working for them
Company have multiple seller which are product provider for company.
I have developed everything and now my client came up with the requirement that
Employees can work for different companies and they only require one login.
Seller can be also work with multiple companies but they also need one login for that.
Things to consider.
I am using Spatie roles and permission package and client wants some thing like:
User A --> Company A --> Role agent.
User A --> Company B --> Role seller.
So far my whole app is working on unique email validation. Can anyone guide me how can I design architecture in which I do not have to rewrite everything all over again.
A company id will be needed as well. if Joe has role of (some role) and works for company (some company id), Joe has access otherwise redirect somewhere.
Where a certain method (function) requires a certain role.
And now requires a company check as well.
So role required is bookkeeper (example only).
Joe is a bookkeeper.
Method process income reports requires role bookkeeper.
PASS, Joe has that role at company C and company W.
Joe cannot mess with any companies bookkeeping except C and W.