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

@@ -14,19 +14,26 @@ use common\models\User;
/**
* TransferController implements the CRUD actions for Transfer model.
*/
class TransferController extends Controller
class TransferController extends \backend\controllers\BackendController
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
// allow authenticated users
[
'actions' => [ 'index','view' ],
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
];
}
/**
* Lists all Transfer models.
@@ -71,7 +78,6 @@ class TransferController extends Controller
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
@@ -85,6 +91,7 @@ class TransferController extends Controller
}
}
*/
/**
* Finds the Transfer model based on its primary key value.