public function setRole($role)
{
$auth = Yii::$app->authManager;
$roleObject = $auth->getRole('registered');
if (!$roleObject) {
throw new yii\base\InvalidParamException ("There is no role \"$role\".");
}
$auth->assign($roleObject, $this->id);
}
Should replace with code below, otherwise it will force to registered role and ignore configuration.
$roleObject = $auth->getRole($role);
Should replace with code below, otherwise it will force to registered role and ignore configuration.
$roleObject = $auth->getRole($role);