Selaa lähdekoodia

Clients : simplification des droits

Correction du bug empêchant les users avec le statut de boulanger de supprimer un client.
dev
keun 6 vuotta sitten
vanhempi
commit
b2be487595
1 muutettua tiedostoa jossa 3 lisäystä ja 23 poistoa
  1. +3
    -23
      backend/controllers/UserController.php

+ 3
- 23
backend/controllers/UserController.php Näytä tiedosto

@@ -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…
Peruuta
Tallenna