* Checks if two privileges have the same resource (same cluster status and db/collection). */
| 563 | * Checks if two privileges have the same resource (same cluster status and db/collection). |
| 564 | */ |
| 565 | static bool |
| 566 | ComparePrivileges(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 | /* |
no outgoing calls
no test coverage detected