How to allow an employee to login to system only if role has been assigned by admin in yii2?

64 views Asked by At

I am using yii2 basic and have implemented RBAC using permissions, roles.

I have Employee table and I have assigned Employee model to user application component.

Now the scenario is when admin creates employee he has to assign a role to that employee using auth_assignment CRUD.

Unless and until role has been assigned, the employee should not be able to login. Login page should be displayed to him with error message. (Similar to the scenario when incorrect username or password is entered by user.)

How to accomplish this?

0

There are 0 answers