hi,
Below given is a block of code for checking whether the user have permission to access an action
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
'access' => [
'class' => AccessControl::className(),
'only' => ['index','index_reseller'],
'rules' => [
[
'allow' => ( Yii::$app->session->get('role') == 2 ) ? TRUE : FALSE,
'actions' => ['index'],
'roles' => ['@'],
],
],
'denyCallback' => function ($rule, $action) {
return $this->redirect(['permission']);
}
],
];
}
so basically a user having role value=2 only can access index action. Can any way one (user with role value not equal to 2) access the index action?