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

Function GetNativeRoleName

pg_documentdb/src/commands/roles.c:1829–1850  ·  view source on GitHub ↗

* GetNativeRoleName maps internal role names to native * role names. This is the inverse of GetInternalRoleName. */

Source from the content-addressed store, hash-verified

1827 * role names. This is the inverse of GetInternalRoleName.
1828 */
1829static const char *
1830GetNativeRoleName(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/*

Callers 2

GrantRoleInheritanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected