mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 13:20:43 +00:00
Do not show fields from join tables that user does not have permission to (e.g., that aren't in meta data)
This commit is contained in:
@ -97,25 +97,28 @@ export default class DataGridUtils
|
|||||||
const columns = [] as GridColDef[];
|
const columns = [] as GridColDef[];
|
||||||
this.addColumnsForTable(tableMetaData, linkBase, columns, columnSort, null, null);
|
this.addColumnsForTable(tableMetaData, linkBase, columns, columnSort, null, null);
|
||||||
|
|
||||||
|
if(metaData)
|
||||||
|
{
|
||||||
if(tableMetaData.exposedJoins)
|
if(tableMetaData.exposedJoins)
|
||||||
{
|
{
|
||||||
for (let i = 0; i < tableMetaData.exposedJoins.length; i++)
|
for (let i = 0; i < tableMetaData.exposedJoins.length; i++)
|
||||||
{
|
{
|
||||||
const join = tableMetaData.exposedJoins[i];
|
const join = tableMetaData.exposedJoins[i];
|
||||||
|
let joinTableName = join.joinTable.name;
|
||||||
let joinLinkBase = null;
|
if(metaData.tables.has(joinTableName) && metaData.tables.get(joinTableName).readPermission)
|
||||||
if(metaData)
|
|
||||||
{
|
{
|
||||||
|
let joinLinkBase = null;
|
||||||
joinLinkBase = metaData.getTablePath(join.joinTable);
|
joinLinkBase = metaData.getTablePath(join.joinTable);
|
||||||
if(joinLinkBase)
|
if(joinLinkBase)
|
||||||
{
|
{
|
||||||
joinLinkBase += joinLinkBase.endsWith("/") ? "" : "/";
|
joinLinkBase += joinLinkBase.endsWith("/") ? "" : "/";
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(join?.joinTable?.fields?.values())
|
if(join?.joinTable?.fields?.values())
|
||||||
{
|
{
|
||||||
this.addColumnsForTable(join.joinTable, joinLinkBase, columns, columnSort, join.joinTable.name + ".", join.label + ": ");
|
this.addColumnsForTable(join.joinTable, joinLinkBase, columns, columnSort, joinTableName + ".", join.label + ": ");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user