mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
user type filter fix
This commit is contained in:
@@ -112,4 +112,21 @@ class User extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
if (!$this->getUser()->isAdmin()) throw new Forbidden();
|
||||
}
|
||||
|
||||
protected function fetchListParamsFromRequest(&$params, $request, $data)
|
||||
{
|
||||
parent::fetchListParamsFromRequest($params, $request, $data);
|
||||
|
||||
$userType = $request->get('userType');
|
||||
|
||||
if ($userType) {
|
||||
$params['where'] = $params['where'] ?? [];
|
||||
|
||||
$params['where'][] = [
|
||||
'type' => 'isOfType',
|
||||
'attribute' => 'id',
|
||||
'value' => $userType,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user