Add BackendController/AccesControl

Add the BackendController for all the backend controllers.
Add AccesControl
This commit is contained in:
2015-11-02 17:27:47 +01:00
parent 1ee0a6bbe9
commit ed1e0b6c2a
17 changed files with 160 additions and 321 deletions

View File

@@ -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.