jstests/replsets/libs/tenant_migration_util.js
/**
     * Creates a role for tenant migration recipient if it doesn't exist.
     */
Creates a role for tenant migration recipient if it doesn't exist.
Creates a role for tenant migration recipient if it doesn ' t exist .
function createTenantMigrationRecipientRoleIfNotExist(rst) {
        const adminDB = rst.getPrimary().getDB("admin");
        if (roleExists(adminDB, "tenantMigrationRecipientRole")) {
            return;
        }
        assert.commandWorked(adminDB.runCommand({
            createRole: "tenantMigrationRecipientRole",
            privileges: [
                {
                    resource: {cluster: true},
                    actions: ["listDatabases", "useUUID", "advanceClusterTime"]
                },
                {resource: {db: "", collection: ""}, actions: ["listCollections"]},
                {
                    resource: {anyResource: true},
                    actions: ["dbStats", "collStats", "find", "listIndexes"]
                }
            ],
            roles: []
        }));
    }
function createTenantMigrationRecipientRoleIfNotExist ( rst ) { const adminDB = rst . getPrimary ( ) . getDB ( "admin" ) ; if ( roleExists ( adminDB , "tenantMigrationRecipientRole" ) ) { return ; } assert . commandWorked ( adminDB . runCommand ( { createRole : "tenantMigrationRecipientRole" , privileges : [ { resource : { cluster : true } , actions : [ "listDatabases" , "useUUID" , "advanceClusterTime" ] } , { resource : { db : "" , collection : "" } , actions : [ "listCollections" ] } , { resource : { anyResource : true } , actions : [ "dbStats" , "collStats" , "find" , "listIndexes" ] } ] , roles : [ ] } ) ) ; }
Creates a role for tenant migration recipient if it doesn't exist.
Creates a role for tenant migration recipient if it doesn ' t exist .