Whether this controller’s actions can be accessed anonymously
If set to false, you are required to be logged in to execute any of the given controller's actions.
If set to true, anonymous access is allowed for all of the given controller's actions.
If the value is an array of action IDs, then you must be logged in for any actions except for the ones in
the array list.
If you have a controller that where the majority of actions allow anonymous access, but you only want require
login on a few, you can set this to true and call requireLogin() in the individual methods.

Returns

Signature

The method will trigger the EVENT_BEFORE_ACTION event. The return value of the method
will determine whether the action should continue to run.

In case the action should not run, the request should be handled inside of the beforeAction code
by either providing the necessary output or redirecting the request. Otherwise the response will be empty.

If you override this method, your code should look like the following:

publicfunctionbeforeAction($action){// your custom code here, if you want the code to run before action filters,// which are triggered on the [EVENT_BEFORE_ACTION](https://www.yiiframework.com/doc/api/2.0/yii-base-controller#EVENT_BEFORE_ACTION-detail) event, e.g. PageCache or AccessControlif(!parent::beforeAction($action)){returnfalse;}// other custom code herereturntrue;// or false to not run the action}