S
S
snchz2020-10-14 19:20:48
PHP
snchz, 2020-10-14 19:20:48

Which architectural solution to choose for user roles?

Good day!

I am writing a project, intracity marketplace

1) Internal roles of the company - Administrator (1), Accountant (2), Logistics Manager (3).

2) Roles of suppliers - Businessman (one who sells his services on the marketplace) (4)
Businessman can create similar roles using the permissions matrix (permissions)
That is, it is the permissions for the Businessman that are checked in the code.

3) Delivery roles - Courier (5)
Can be created both by the company and the Seller

4) Client (order, payment for goods) (6)

I hope I grouped it clearly enough.
So to the point. An idea popped into my head right now
In general, spread it all into 4 (well, or a little more compactly 3) different tables, make 4 different inputs. (since the control panels for the roles are still different)
+From the pros
1) it's easier to operate permissions inside the Suppliers section.
2) Separate Admins into a separate group.
3) Separate Clients into a separate group (which means that any supplier can essentially have a separate client account)

- Of the minuses (these are 4 different tables)))

I would like to hear if this is generally an adequate solution in this situation, or is it better to adhere to standard practices and build everything completely on permissions and their grouping in roles?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2020-10-14
@inoise

What difference does it make what the roles are called. It is worth reading about RBAC or ACL. I don't know which of them is commonly used in laravel. I am for the first

A
Anton Shamanov, 2020-10-14
@SilenceOfWinter

I think it’s worth starting with BDD tests and such questions will disappear on their own

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question