Browse Source

Clients : simplification des droits

Correction du bug empêchant les users avec le statut de boulanger de supprimer un client.
dev
keun 6 years ago
parent
commit
b2be487595
1 changed files with 3 additions and 23 deletions
  1. +3
    -23
      backend/controllers/UserController.php

+ 3
- 23
backend/controllers/UserController.php View File

@@ -21,17 +21,8 @@ class UserController extends BackendController {
'allow' => true,
'roles' => ['@'],
'matchCallback' => function ($rule, $action) {
if ($action->actionMethod == 'actionIndex' ||
$action->actionMethod == 'actionCreate' ||
$action->actionMethod == 'actionUpdate' ||
$action->actionMethod == 'actionCredit' ||
$action->actionMethod == 'actionMail' ||
$action->actionMethod == 'actionCommandes') {
return Yii::$app->user->identity->status == User::STATUS_ADMIN
|| Yii::$app->user->identity->status == User::STATUS_BOULANGER;
} else {
return Yii::$app->user->identity->status == User::STATUS_ADMIN;
}
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
}
]
],
@@ -69,18 +60,7 @@ class UserController extends BackendController {
'section_clients_inactifs' => $section_clients_inactifs,
]);
}

/**
* Displays a single User model.
* @param integer $id
* @return mixed
*/
public function actionView($id) {
return $this->render('view', [
'model' => $this->findModel($id),
]);
}

/**
* Creates a new User model.
* If creation is successful, the browser will be redirected to the 'view' page.

Loading…
Cancel
Save