Implementing Db Rbac Check As Filter In Controller

How to implement db rbac access check in controller as filter?


public function behaviors()

{

    return [

        'access' => [

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

            'rules' => [

                [

                    'allow' => true,

                    'roles' => ['canEditThis', '...'],

                ]

            ],

        ],

    ];

}

Yes, this method is working, but as I understand, I need input roles to ‘roles’ array manually. I want to input roles in db, and controller apply it automatically.

I suppose you want this.

ok, i will look at it. Thank you.