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

Function ComparePrivileges

pg_documentdb/src/utils/role_utils.c:565–581  ·  view source on GitHub ↗

* Checks if two privileges have the same resource (same cluster status and db/collection). */

Source from the content-addressed store, hash-verified

563 * Checks if two privileges have the same resource (same cluster status and db/collection).
564 */
565static bool
566ComparePrivileges(const ConsolidatedPrivilege *privilege1,
567 const Privilege *privilege2)
568{
569 if (privilege1->isCluster != privilege2->isCluster)
570 {
571 return false;
572 }
573
574 if (privilege1->isCluster)
575 {
576 return true;
577 }
578
579 return (strcmp(privilege1->db, privilege2->db) == 0 &&
580 strcmp(privilege1->collection, privilege2->collection) == 0);
581}
582
583
584/*

Callers 1

ConsolidatePrivilegeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected