Add BackendController/AccesControl
Add the BackendController for all the backend controllers. Add AccesControl
This commit is contained in:
@@ -12,31 +12,8 @@ use yii\filters\VerbFilter;
|
||||
/**
|
||||
* AccountController implements the CRUD actions for Account model.
|
||||
*/
|
||||
class AccountController extends Controller
|
||||
class AccountController 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 Account models.
|
||||
@@ -102,18 +79,6 @@ class AccountController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes an existing Account model.
|
||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||
* @param integer $id
|
||||
* @return mixed
|
||||
*/
|
||||
// public function actionDelete($id)
|
||||
// {
|
||||
// $this->findModel($id)->delete();
|
||||
|
||||
// return $this->redirect(['index']);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Finds the Account model based on its primary key value.
|
||||
|
||||
Reference in New Issue
Block a user