|
|
@@ -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. |