问题
I want to create a application where role will be different like (Admin, Partner, Student,Trainer), And I want to separate session/Auth for each role and login too. I do not want to login with Users table, even want to with student, trainer like that. Please help me.
回答1:
Don't make things complex:
Manage your login access from two tables:
Roles:
This should include all role types
Users:
This should include at least login information like username/email, password etc.
And obviously make relations like:
Users belongs to Roles , means each user has different role.
You can manage login separately according to their role (see here). On doing so yo don't need to login them from different table.I bet that just make things complex.
来源:https://stackoverflow.com/questions/40928653/how-to-create-separate-login-for-frontend-and-backend-using-cakephp-3-0-and-sess