mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 21:41:19 +08:00
Update security-authorization.md (#18667)
change deprecated function to actual
This commit is contained in:
@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user