File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -396,9 +396,10 @@ public function signup()
396396 $user->save(false);
397397
398398 // the following three lines were added:
399- $auth = \Yii::$app->authManager;
400- $authorRole = $auth->getRole('author');
401- $auth->assign($authorRole, $user->getId());
399+ $authorRole = $this->manager->getRole('author');
400+ if ($authorRole !== null) {
401+ $this->manager->assign($authorRole->getName(), $user->getId());
402+ }
402403
403404 return $user;
404405 }
@@ -408,7 +409,7 @@ public function signup()
408409```
409410
410411For applications that require complex access control with dynamically updated authorization data
411- (such as an admin panel), you many need to develop special user interfaces using APIs offered by ` authManager ` .
412+ (such as an admin panel), you many need to develop special user interfaces using APIs offered by ` Yiisoft\Rbac\Manager ` .
412413
413414
414415### Using rules <span id =" using-rules " ></span >
You can’t perform that action at this time.
0 commit comments