Skip to content

Commit

Permalink
add roleMapping to tenant creation step
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybellwood committed Apr 27, 2022
1 parent 52f67d7 commit a51fa39
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions services/api/src/resources/group/opendistroSecurity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,14 @@ export const OpendistroSecurityOperations = (
logger.debug(`${groupName}: Created Tenant "${tenantName}"`);
} catch (err) {
logger.error(`Opendistro-Security create tenant error: ${err}`);
};

try {
// Create a new RoleMapping for this Group
await opendistroSecurityClient.put(`rolesmapping/${tenantName}`, { body: { backend_roles: [`${tenantName}`] } });
logger.debug(`${groupName}: Created RoleMapping "${tenantName}"`);
} catch (err) {
logger.error(`Opendistro-Security create rolemapping error: ${err}`);
}
}

Expand Down

0 comments on commit a51fa39

Please sign in to comment.