MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecCheckRTPerms

Function ExecCheckRTPerms

src/backend/executor/execMain.c:1448–1473  ·  view source on GitHub ↗

* ExecCheckRTPerms * Check access permissions for all relations listed in a range table. * * Returns true if permissions are adequate. Otherwise, throws an appropriate * error if ereport_on_violation is true, or simply returns false otherwise. * * Note that this does NOT address row-level security policies (aka: RLS). If * rows will be returned to the user as a result of this permission

Source from the content-addressed store, hash-verified

1446 * See rewrite/rowsecurity.c.
1447 */
1448bool
1449ExecCheckRTPerms(List *rangeTable, bool ereport_on_violation)
1450{
1451 ListCell *l;
1452 bool result = true;
1453
1454 foreach(l, rangeTable)
1455 {
1456 RangeTblEntry *rte = (RangeTblEntry *) lfirst(l);
1457
1458 result = ExecCheckRTEPerms(rte);
1459 if (!result)
1460 {
1461 Assert(rte->rtekind == RTE_RELATION);
1462 if (ereport_on_violation)
1463 aclcheck_error(ACLCHECK_NO_PRIV, get_relkind_objtype(get_rel_relkind(rte->relid)),
1464 get_rel_name(rte->relid));
1465 return false;
1466 }
1467 }
1468
1469 if (ExecutorCheckPerms_hook)
1470 result = (*ExecutorCheckPerms_hook) (rangeTable,
1471 ereport_on_violation);
1472 return result;
1473}
1474
1475/*
1476 * ExecCheckRTEPerms

Callers 4

RI_Initial_CheckFunction · 0.85
DoCopyFunction · 0.85
CheckRTPermissionsMethod · 0.85
InitPlanFunction · 0.85

Calls 6

ExecCheckRTEPermsFunction · 0.85
aclcheck_errorFunction · 0.85
get_relkind_objtypeFunction · 0.85
get_rel_relkindFunction · 0.85
get_rel_nameFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected