jstests/replsets/libs/tenant_migration_util.js
/**
     * Creates a role for tenant migration donor if it doesn't exist.
     */
Creates a role for tenant migration donor if it doesn't exist.
Creates a role for tenant migration donor if it doesn ' t exist .
function createTenantMigrationDonorRoleIfNotExist(rst) {
        const adminDB = rst.getPrimary().getDB("admin");
        if (roleExists(adminDB, "tenantMigrationDonorRole")) {
            return;
        }
        assert.commandWorked(adminDB.runCommand({
            createRole: "tenantMigrationDonorRole",
            privileges: [
                {resource: {cluster: true}, actions: ["runTenantMigration"]},
                {resource: {db: "admin", collection: "system.keys"}, actions: ["find"]}
            ],
            roles: []
        }));
    }
function createTenantMigrationDonorRoleIfNotExist ( rst ) { const adminDB = rst . getPrimary ( ) . getDB ( "admin" ) ; if ( roleExists ( adminDB , "tenantMigrationDonorRole" ) ) { return ; } assert . commandWorked ( adminDB . runCommand ( { createRole : "tenantMigrationDonorRole" , privileges : [ { resource : { cluster : true } , actions : [ "runTenantMigration" ] } , { resource : { db : "admin" , collection : "system.keys" } , actions : [ "find" ] } ] , roles : [ ] } ) ) ; }
Creates a role for tenant migration donor if it doesn't exist.
Creates a role for tenant migration donor if it doesn ' t exist .