* Consolidates privileges for a role and * writes them to the provided BSON array writer. */
| 270 | * writes them to the provided BSON array writer. |
| 271 | */ |
| 272 | void |
| 273 | WritePrivileges(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 | /* |
no test coverage detected