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

@@ -15,19 +15,26 @@ use yii\helpers\Json;
/**
* CityController implements the CRUD actions for City model.
*/
class CityController extends Controller
class CityController extends \backend\controllers\BackendController
{
public function behaviors()
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
// allow authenticated users
[
'actions' => [ 'create','index','view','update','name-list','zip-list'],
'allow' => true,
'roles' => ['@'],
],
// everything else is denied
],
],
];
}
/**
* Lists all City models.