Skip to content

Commit ef9b920

Browse files
klsoft-webvjik
andauthored
Refactoring authorization docs (#341)
Co-authored-by: Sergei Predvoditelev <sergei@predvoditelev.ru>
1 parent 195f109 commit ef9b920

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/guide/security/authorization.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff 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

410411
For 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>

0 commit comments

Comments
 (0)