I am using yii2-admin for role-based access control. In this module, we need to check the access in each action like
if (\Yii::$app->user->can('createPost')) {
// create post
}
or like
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'actions' => ['create'],
'roles' => ['createPost'],
],
]
]
];
}
But in yii-1 the rights module provides an option to check the access control by extending a controller (RController). Do we have such an option in yii2-admin ?