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

Function WriteMultipleRoles

pg_documentdb/src/commands/users.c:1716–1731  ·  view source on GitHub ↗

* WriteMultipleRoles iterates through the roles HTAB and writes each role to the provided BSON array writer. * This is used to write roles for usersInfo and connectionStatus commands. */

Source from the content-addressed store, hash-verified

1714 * This is used to write roles for usersInfo and connectionStatus commands.
1715 */
1716static void
1717WriteMultipleRoles(HTAB *rolesTable, pgbson_array_writer *roleArrayWriter)
1718{
1719 if (rolesTable == NULL)
1720 {
1721 return;
1722 }
1723
1724 HASH_SEQ_STATUS status;
1725 StringView *roleEntry;
1726 hash_seq_init(&status, rolesTable);
1727 while ((roleEntry = hash_seq_search(&status)) != NULL)
1728 {
1729 WriteRoles(roleEntry->string, roleArrayWriter);
1730 }
1731}
1732
1733
1734/*

Callers 1

WriteSingleUserDocumentFunction · 0.85

Calls 1

WriteRolesFunction · 0.70

Tested by

no test coverage detected