Commit 3ffd2e94 authored by Varunkumar Manohar's avatar Varunkumar Manohar Committed by varungbt
Browse files

Update handler.ts

parent 0bf4ab4b
Pipeline #58056 passed with stages
in 11 minutes and 36 seconds
......@@ -130,12 +130,14 @@ export class SubProjectHandler {
if (FeatureFlags.isEnabled(Feature.AUTHORIZATION)) {
// provision new groups
await AuthGroups.createGroup(userToken, adminGroupName,
'seismic dms tenant ' + tenant.name + ' subproject ' + subproject.name + ' admin group',
tenant.esd, req[Config.DE_FORWARD_APPKEY]);
await AuthGroups.createGroup(userToken, viewerGroupName,
'seismic dms tenant ' + tenant.name + ' subproject ' + subproject.name + ' editor group',
tenant.esd, req[Config.DE_FORWARD_APPKEY]);
await Promise.all([
AuthGroups.createGroup(userToken, adminGroupName,
'seismic dms tenant ' + tenant.name + ' subproject ' + subproject.name + ' admin group',
tenant.esd, req[Config.DE_FORWARD_APPKEY]),
AuthGroups.createGroup(userToken, viewerGroupName,
'seismic dms tenant ' + tenant.name + ' subproject ' + subproject.name + ' editor group',
tenant.esd, req[Config.DE_FORWARD_APPKEY])]
);
}
subproject.gcs_bucket = await this.getBucketName(tenant);
......@@ -163,11 +165,12 @@ export class SubProjectHandler {
// if admin is not the requestor, assign the admin and rm the requestor, has to be a sequential op
if (subprojectCreatorEmail !== userEmail) {
await AuthGroups.addUserToGroup(userToken, adminGroup, subprojectCreatorEmail,
tenant.esd, req[Config.DE_FORWARD_APPKEY], 'OWNER', true);
await AuthGroups.addUserToGroup(userToken, viewerGroup, subprojectCreatorEmail,
tenant.esd, req[Config.DE_FORWARD_APPKEY], 'OWNER', true);
await Promise.all([
AuthGroups.addUserToGroup(userToken, adminGroup, subprojectCreatorEmail,
tenant.esd, req[Config.DE_FORWARD_APPKEY], 'OWNER', true),
AuthGroups.addUserToGroup(userToken, viewerGroup, subprojectCreatorEmail,
tenant.esd, req[Config.DE_FORWARD_APPKEY], 'OWNER', true)
]);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment