src/base/Controller.php
public function getRules()
    {
        return [
            [
                'allow' => true,
                'actions' => [], // apply to all actions by default
                'roles' => ['@'],
                'matchCallback' => function ($rule, $action) {
                    // see if a controller property has been defined to disabled the permission checks
                    if ($action->controller->disablePermissionCheck) {
                        return true;
                    }
                    // get the route based on the current $action object
                    $route = implode('/', [$action->controller->module->id, $action->controller->id, $action->id]);
                    
                    UserOnline::refreshUser($this->user->identity, $route);
                    
                    // check the access inside auth->matchRoute and return true/false.
                    return Yii::$app->auth->matchRoute($this->user->id, $route);
                },
            ],
        ];
    }
public function getRules()
    {
        return [
            [
                'allow' => true,
                'actions' => [], // apply to all actions by default
                'roles' => ['@'],
                'matchCallback' => function ($rule, $action) {
                    // see if a controller property has been defined to disabled the permission checks
                    if ($action->controller->disablePermissionCheck) {
                        return true;
                    }
                    // get the route based on the current $action object
                    $route = implode('/', [$action->controller->module->id, $action->controller->id, $action->id]);
                    
                    UserOnline::refreshUser($this->user->identity, $route);
                    
                    // check the access inside auth->matchRoute and return true/false.
                    return Yii::$app->auth->matchRoute($this->user->id, $route);
                },
            ],
        ];
    }
public function getRules ( ) { return [ [ 'allow' => true , 'actions' => [ ] , // apply to all actions by default 'roles' => [ '@' ] , 'matchCallback' => function ( $ rule , $ action ) { // see if a controller property has been defined to disabled the permission checks if ( $ action -> controller -> disablePermissionCheck ) { return true ; } // get the route based on the current $action object $ route = implode ( '/' , [ $ action -> controller -> module -> id , $ action -> controller -> id , $ action -> id ] ) ; UserOnline :: refreshUser ( $ this -> user -> identity , $ route ) ; // check the access inside auth->matchRoute and return true/false. return Yii :: $ app -> auth -> matchRoute ( $ this -> user -> id , $ route ) ; } , ] , ] ; }
Returns the rules for the AccessControl filter behavior.

The rules are applied as following:

1. Administration User must be logged in, this is by default for all actions inside the controller.
2. Check the current given route against {{luya\admin\components\Auth::matchRoute()}}.
2a. If {{luya\admin\base\Controller::$disabledPermissionCheck}} enabled, the match route behavior is disabled.

@return array A list of rules.
@see yii\filters\AccessControl
Returns the rules for the AccessControl filter behavior .