Add BackendController/AccesControl
Add the BackendController for all the backend controllers. Add AccesControl
This commit is contained in:
@@ -12,32 +12,8 @@ use yii\filters\VerbFilter;
|
||||
/**
|
||||
* ProductCategoryController implements the CRUD actions for ProductCategory model.
|
||||
*/
|
||||
class ProductCategoryController extends Controller
|
||||
class ProductCategoryController extends \backend\controllers\BackendController
|
||||
{
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
'verbs' => [
|
||||
'class' => VerbFilter::className(),
|
||||
'actions' => [
|
||||
'delete' => ['post'],
|
||||
],
|
||||
],
|
||||
'access' => [
|
||||
'class' => \yii\filters\AccessControl::className(),
|
||||
'only' => [ 'index','view','create','update'],
|
||||
'rules' => [
|
||||
// allow authenticated users
|
||||
[
|
||||
'allow' => true,
|
||||
'roles' => ['@'],
|
||||
],
|
||||
// everything else is denied
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Lists all ProductCategory models.
|
||||
|
||||
Reference in New Issue
Block a user