|
|
@@ -856,10 +856,20 @@ jQuery('#typeahead-{$fName}').typeahead({
|
|
|
}
|
|
|
}
|
|
|
DBG::log(['msg'=>"this", $this]);
|
|
|
- // TODO: for all tables filter rows by acl groups
|
|
|
- // 'tblAliasList' => [
|
|
|
- // 4095 => 'ADMIN_USERS',
|
|
|
- // ),
|
|
|
+ Lib::loadClass('ACL');
|
|
|
+ Lib::loadClass('AclQueryFeatures');
|
|
|
+ $andSql = array_map(
|
|
|
+ function ($tableName, $idTable) {
|
|
|
+ $tableAcl = User::getAcl()->getObjectAcl('default_db', $tableName);
|
|
|
+ return ACL::query($tableAcl, "t_{$idTable}")
|
|
|
+ ->where( (new AclQueryFeatures($tableAcl, $params = []))->parseSpecialFilterAccess() )
|
|
|
+ ->generateWhereSql()
|
|
|
+ ;
|
|
|
+ },
|
|
|
+ $this->tblAliasList, array_keys($this->tblAliasList)
|
|
|
+ );
|
|
|
+ $andSql = array_filter($andSql, ['V', 'filterNotEmpty']);
|
|
|
+ if (!empty($andSql)) $sqlWhereAdd .= "\n" . " and " . implode(" and ", $andSql);
|
|
|
$sqlLimit = V::get('limit', 0, $this->sqlQuery, 'int');
|
|
|
$sqlLimit = ($sqlLimit > 0) ? $sqlLimit : 20;
|
|
|
|