Answer the question
In order to leave comments, you need to log in
How to link rbac roles and user model?
1. Delivered pure yii2.
2. I stuck dektrium / rbac to it.
3. Created a user table (fk user.role to auth_item.name) and then generated CRUD using gii.
As a result, the model has such a rule:
public function rules()
{
return [
...
,
];
}
Answer the question
In order to leave comments, you need to log in
AuthItem has no find method
When creating an entry, he swears that AuthItem does not have a find method.
['level', 'in', 'range' => Yii::$app->authManager->getRoles()],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question