now there are three roles: general factory, middleman, and customer.
the framework I use is the laravel framework
I have built three middleware:
BackendRole.php / / function: only allow factory access
ShopRole.php / / function: only allow middlemen to access
ClientRole.php / / function: only allow customers to access
so, if I want to implement permission control on a single side, it will be easy, just (laravel routing code):
//
Route::middleware("BackendRole")->group(function () {
//...
});
however, if I want to have access to both the factory and the customer, or to the factory and the middleman at the same time, this pairwise combination will be more difficult to achieve in this way.
so, in a situation like this, how can middleware be used to flexibly control access?