Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add role/group support for bulk import users #4265

Merged
merged 15 commits into from
Oct 25, 2023

Conversation

PasinduYeshan
Copy link
Contributor

@PasinduYeshan PasinduYeshan commented Oct 20, 2023

Purpose

This PR provides support for roles and groups support for bulk user import.

Related Issues

Related PRs

Checklist

  • e2e cypress tests locally verified.
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Unit tests provided. (Add links if there are any)
  • Integration tests provided. (Add links if there are any)

Security checks

@PasinduYeshan
Copy link
Contributor Author

Current plan:

image

CSV file:

UserName,givenname,mobile,emailaddress,addresses.locality,region,title,roles,groups
[email protected],givenName0,0773477770,[email protected],Gurugoda,region0,title0,testRole1|testRole2,testGroup1
[email protected],givenName1,0773477771,[email protected],locality1,region1,title2,testRole2,testGroup2
  • User creation and assigning users to roles and groups happens as separate operations in the backend.
  • User creation and assignment request is sent to the scim2/Bulk endpoint as one request.
  • The response from the scim2/Bulk endpoint doesn’t provide a straightforward way to ascertain the mapping of users to roles or groups, necessitating a cumbersome processing of the user-provided CSV.
  • To mitigate this, the strategy is to flag any instances of failed role or group patching.
  • In the illustrated example, since [email protected] is already present in the system, the user creation operation fails, subsequently leading to the failure of corresponding role and group assignments.
  • Should a user encounter a failure in role or group assignment, this will result in the failure of role or group assignments for other users intended to be assigned to the same role or group as the failed user.

@PasinduYeshan PasinduYeshan marked this pull request as ready for review October 24, 2023 11:58
@PasinduYeshan
Copy link
Contributor Author

PasinduYeshan commented Oct 24, 2023

Updated views:

Screenshot 2023-10-24 at 16 46 20

Screenshot 2023-10-24 at 16 46 26

CSV

UserName,givenname,mobile,emailaddress,addresses.locality,region,title,roles,groups
[email protected],givenName0,0773477770,[email protected],Gurugoda,region0,title0,testingRole3|testingRole2,testingGroup1
[email protected],givenName1,0773477771,[email protected],locality1,region1,title2,testingRole1,testingGroup2
[email protected],givenName1,0773477771,[email protected],locality1,region1,title2,testingRole1,testingGroup2
[email protected],givenName1,0773477771,[email protected],locality1,region1,title2,testingRole2|testingRole1,testingGroup3

Roles and groups should be provided, separated by "|" as illustrated in the CSV file above.

Important Note

  • Only organization v2 roles are supported.

key={ item.key }
label={ (
<div className="beta-feature-tab-item">
<Typography sx={ { fontWeight: 500 } }>{ item.text }</Typography>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid inline styles

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PasinduYeshan Whats the conclusion here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach had been used in other places 1. Due to the urgency, I might have missed this. This needs to be fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve this comment, and add the issue which you were mentioning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants