* ProcessAllRolesForRolesInfo handles the case when showAllRoles is true * Iterate over all roles in the pre-built inheritance table. */
| 1121 | * Iterate over all roles in the pre-built inheritance table. |
| 1122 | */ |
| 1123 | static void |
| 1124 | ProcessAllRolesForRolesInfo(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 | /* |
no test coverage detected