|
|
|
|
|
|
|
|
'allow' => true, |
|
|
'allow' => true, |
|
|
'roles' => ['@'], |
|
|
'roles' => ['@'], |
|
|
'matchCallback' => function ($rule, $action) { |
|
|
'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; |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
'section_clients_inactifs' => $section_clients_inactifs, |
|
|
'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. |
|
|
* Creates a new User model. |
|
|
* If creation is successful, the browser will be redirected to the 'view' page. |
|
|
* If creation is successful, the browser will be redirected to the 'view' page. |