* GetNativeRoleName maps internal role names to native * role names. This is the inverse of GetInternalRoleName. */
| 1827 | * role names. This is the inverse of GetInternalRoleName. |
| 1828 | */ |
| 1829 | static const char * |
| 1830 | GetNativeRoleName(const char *internalRoleName) |
| 1831 | { |
| 1832 | if (strcmp(internalRoleName, ApiClusterAdminRole) == 0) |
| 1833 | { |
| 1834 | return "clusterAdmin"; |
| 1835 | } |
| 1836 | else if (strcmp(internalRoleName, ApiReadOnlyRole) == 0) |
| 1837 | { |
| 1838 | return "readAnyDatabase"; |
| 1839 | } |
| 1840 | else if (strcmp(internalRoleName, ApiReadWriteRole) == 0) |
| 1841 | { |
| 1842 | return "readWriteAnyDatabase"; |
| 1843 | } |
| 1844 | else if (strcmp(internalRoleName, ApiRootInternalRole) == 0) |
| 1845 | { |
| 1846 | return "root"; |
| 1847 | } |
| 1848 | |
| 1849 | return internalRoleName; |
| 1850 | } |
| 1851 | |
| 1852 | |
| 1853 | /* |
no outgoing calls
no test coverage detected