add role checking to controllers
This commit is contained in:
@@ -6,6 +6,7 @@ use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\Procurement;
|
||||
use common\components\RoleDefinition;
|
||||
|
||||
/**
|
||||
* ProcurementSearch represents the model behind the search form about `common\models\Procurement`.
|
||||
@@ -55,6 +56,10 @@ class ProcurementSearch extends Procurement
|
||||
'query' => $query,
|
||||
]);
|
||||
|
||||
if ( RoleDefinition::isReception()){
|
||||
$query->andWhere(['id_user' => Yii::$app->user->id ]);
|
||||
}
|
||||
|
||||
$this->load($params);
|
||||
|
||||
if (!$this->validate()) {
|
||||
|
||||
Reference in New Issue
Block a user