Update security-authorization.md (#18667)

change deprecated function to actual
This commit is contained in:
RomanBush
2021-05-20 22:26:41 +03:00
committed by GitHub
parent 9780b46185
commit f7e29678a7

View File

@ -25,7 +25,7 @@ class SiteController extends Controller
{ {
return [ return [
'access' => [ 'access' => [
'class' => AccessControl::className(), 'class' => AccessControl::class,
'only' => ['login', 'logout', 'signup'], 'only' => ['login', 'logout', 'signup'],
'rules' => [ 'rules' => [
[ [
@ -70,7 +70,7 @@ You may customize this behavior by configuring the [[yii\filters\AccessControl::
```php ```php
[ [
'class' => AccessControl::className(), 'class' => AccessControl::class,
... ...
'denyCallback' => function ($rule, $action) { 'denyCallback' => function ($rule, $action) {
throw new \Exception('You are not allowed to access this page'); throw new \Exception('You are not allowed to access this page');
@ -129,7 +129,7 @@ class SiteController extends Controller
{ {
return [ return [
'access' => [ 'access' => [
'class' => AccessControl::className(), 'class' => AccessControl::class,
'only' => ['special-callback'], 'only' => ['special-callback'],
'rules' => [ 'rules' => [
[ [
@ -538,7 +538,7 @@ public function behaviors()
{ {
return [ return [
'access' => [ 'access' => [
'class' => AccessControl::className(), 'class' => AccessControl::class,
'rules' => [ 'rules' => [
[ [
'allow' => true, 'allow' => true,