Accesscontrol forbidden

Hi,

i’m not sure why my access control on my backend is not working.

public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::class,
                'actions' => [
                    'sales-report' => ['GET']
                ],
            ],
            'access' => [
                'class' => AccessControl::class,
                'only' => [
                    'sales-report'
                ],
                'rules' => [
                    [   
                        'actions' => ['sales-report'],
                        'allow' => true,
                        'roles' => ['@'],
                    ],
                ],
            ],
        ];
    }

i’m getting this error

An Error occurred while handling another error:
yii\web\ForbiddenHttpException: You are not allowed to perform this action. in C:\MAMP\htdocs\blabla\vendor\yiisoft\yii2\filters\AccessControl.php:158
Stack trace:

my url manager looks like this

    //module friendly URL
    '<module:\w+>/<controller:\w+>/<action:\w+>/<id:\d+>' => '<module>/<controller>/<action>',
    '<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',

    '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
    '<controller:\w+>/<action:\w+>' => '<controller>/<action>',

any idea what i’m missing here? thank you

Found the issue.

    '<module:[\w-]+>/<controller:[\w-]+>/<action:[\w-]+>/<id:\d+>' => '<module>/<controller>/<action>',
    '<module:[\w-]+>/<controller:[\w-]+>/<action:[\w-]+>' => '<module>/<controller>/<action>',

    '<controller:[\w-]+>/<action:[\w-]+>/<id:\d+>' => '<controller>/<action>',
    '<controller:[\w-]+>/<action:[\w-]+>' => '<controller>/<action>',

had to change all \w+ to [\w-]+ to allow dashes in URL