Checkaccess Error After Composer Update To Beta.

I have been building an app with Yii2 for about two months and now I’ve just updated Yii with composer to what I assume is beta. It has caused a few issues but most I’ve been able to resolve. However I am stuck on this error:




Call to a member function checkAccess() on a non-object



… in file /var/www/vendor/yiisoft/yii2/web/User.php

I am setting up authorisation rules like so:




        public function behaviors()

        {

                return [

                        'verbs' => [

                                'class' => VerbFilter::className(),

                                'actions' => [

                                        'delete' => ['post'],

                                ],

                        ],

            'access' => [

                'class' => '\yii\filters\AccessControl',

                'rules' => [

                    [

                        'allow' => true,

                        'actions' => ['update', 'delete', 'create'],

                        'roles' => ['@'],

                    ],

                    [

                        'allow' => true,

                        'actions' => ['full-listing', 'view'],

                        'roles' => ['*'],

                    ],

                ]

            ]

        }  



Can anyone suggest what I need to do?

Access control was heavily redesigned, check the actual documentation and modify your code accordingly.

Thanks for the response ORey. I had tried every combination I could but I discovered the Chrome seemed to be heavily caching the page so any changes I made were not reflected. All is working in Firefox.

Yeah, Chrome wasted my time in the same manner many times. It’s good as browser but I hate it for doing that.

Create a clear_cache.bat or clear_cache.sh script to clear your browser cache (based on your client environment).

Thanks for the responses. I tried clearing the cache from the shell and was surprised to see that stylesheets not loading from other sites without refreshing multiple times. It does highlight how aggressively Chrome tries to cache things and speed up page loads.