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

Function WritePrivileges

pg_documentdb/src/utils/role_utils.c:272–288  ·  view source on GitHub ↗

* Consolidates privileges for a role and * writes them to the provided BSON array writer. */

Source from the content-addressed store, hash-verified

270 * writes them to the provided BSON array writer.
271 */
272void
273WritePrivileges(const char *internalRoleName,
274 pgbson_array_writer *privilegesArrayWriter)
275{
276 if (internalRoleName == NULL)
277 {
278 ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
279 errmsg("Role name cannot be NULL.")));
280 }
281
282 List *consolidatedPrivileges = NIL;
283
284 ConsolidatePrivilegesForRole(internalRoleName, &consolidatedPrivileges);
285
286 WritePrivilegeListToArray(consolidatedPrivileges, privilegesArrayWriter);
287 DeepFreePrivileges(consolidatedPrivileges);
288}
289
290
291/*

Callers 2

connection_statusFunction · 0.85
WriteRoleResponseFunction · 0.85

Calls 3

DeepFreePrivilegesFunction · 0.85

Tested by

no test coverage detected