Sfoglia il codice sorgente

Clients : simplification des droits

Correction du bug empêchant les users avec le statut de boulanger de supprimer un client.
dev
keun 6 anni fa
parent
commit
b2be487595
1 ha cambiato i file con 3 aggiunte e 23 eliminazioni
  1. +3
    -23
      backend/controllers/UserController.php

+ 3
- 23
backend/controllers/UserController.php Vedi 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…
Annulla
Salva