MCPcopy Create free account
hub / github.com/documentdb/documentdb / ProcessAllRolesForRolesInfo

Function ProcessAllRolesForRolesInfo

pg_documentdb/src/commands/roles.c:1123–1147  ·  view source on GitHub ↗

* ProcessAllRolesForRolesInfo handles the case when showAllRoles is true * Iterate over all roles in the pre-built inheritance table. */

Source from the content-addressed store, hash-verified

1121 * Iterate over all roles in the pre-built inheritance table.
1122 */
1123static void
1124ProcessAllRolesForRolesInfo(pgbson_array_writer *rolesArrayWriter, RolesInfoSpec
1125 rolesInfoSpec,
1126 HTAB *roleInheritanceTable)
1127{
1128 HASH_SEQ_STATUS status;
1129 RoleParentEntry *entry;
1130
1131 hash_seq_init(&status, roleInheritanceTable);
1132 while ((entry = hash_seq_search(&status)) != NULL)
1133 {
1134 const char *internalRoleName = entry->internalRoleName;
1135 const char *nativeRoleName = entry->nativeRoleName;
1136
1137 /* Exclude built-in roles if not requested */
1138 if (!rolesInfoSpec.showBuiltInRoles &&
1139 IS_NATIVE_BUILTIN_ROLE(nativeRoleName))
1140 {
1141 continue;
1142 }
1143
1144 WriteRoleResponse(internalRoleName, rolesArrayWriter,
1145 rolesInfoSpec, roleInheritanceTable);
1146 }
1147}
1148
1149
1150/*

Callers 1

roles_infoFunction · 0.85

Calls 1

WriteRoleResponseFunction · 0.85

Tested by

no test coverage detected