How to structure the user roles and things

Hello guys,

I was wondering if anyone could help me design the structure of the user roles based on the attached image I´ve designed.

I´ll make an example: in the app there will be users that has several companies and this companies will have clients, providers, clients_invoices, providers_invoices, …

So User1 for example will have the Company1 where he can create clients, invoices for clients, … and this User1 wants to add an external user that can just read the data inside of the Company1, for example an accountant or bookkeeper.

That´s the situation I want to achieve.

Thanks a lot in advance.

For the admin/user role you need is a field on the user, such as “user_type” to determine if a user is a “user” or “admin”. This could be a text field or yes/no. Text is a bit more annoying to program, and is case sensitive, but allows more flexibility if you plan to add more roles in the future.

On the company thing I would create a list of users that represents who is able to read/ access that page.

For example, you could have a redirect on the “Company” page, so a user is redirected elsewhere, unless they are on the “list_of_approved_people” (or whatever you call it).

When the first user wants to invite a second, uses the “Create a User for Someone Else Action” as step 1, and Add user to “list_of_approved_people”.

At least, that’s how I would approach it. Perhaps somebody else can provide a better suggestion.

1 Like

Thanks for your reply @csblack,

I forgot to ask but should I have to define a role under the privacy tab?