Add BackendController/AccesControl
Add the BackendController for all the backend controllers. Add AccesControl
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user