yii2 role based scenario

75 Views Asked by At

I'm developing a yii2 rest api based app that has different roles of users (Admin, Customer, Shop, Service). I'm planning to use scenarios with one user database table contains union of fields that requires all roles. (80% is the same) I would like to define different validation types, different visible fildes and different related records based on scenario(user role). As i see it is possible.

My question is: Is it a good solution or scenarios tend to be only for handling validation differences for the same object (ex.: update, create, regsiter, etc...) and i should make multiple user tables not roles?

Thanks

0

There are 0 best solutions below