Skip to content

feat: bulk update roles#1596

Open
TCMeldrum wants to merge 3 commits into
developfrom
bulk-roles-assignments
Open

feat: bulk update roles#1596
TCMeldrum wants to merge 3 commits into
developfrom
bulk-roles-assignments

Conversation

@TCMeldrum

@TCMeldrum TCMeldrum commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Description

Implemented bulk update functionality for user roles.

Motivation and Context

This change is required to enable the bulk assignment and removal of roles to multiple users at once, improving the efficiency of user management tasks.

Changes

  1. Added two new methods in the UserDataSource interface (addUsersRoles and removeUsersRoles) to handle bulk operations.
  2. Implemented the two new methods in the PostgresUserDataSource and StfcUserDataSource classes.
  3. Added new mutations (addRolesToUsers and removeRolesFromUsers) in UserMutations to expose these new functionalities to the API.

How Has This Been Tested?

Fixes Jira Issue

https://jira.ess.eu//browse/

Depends On

Tests included/Docs Updated?

  • I have added tests to cover my changes.
  • All relevant doc has been updated

@TCMeldrum TCMeldrum marked this pull request as ready for review June 26, 2026 10:28
@TCMeldrum TCMeldrum requested a review from a team as a code owner June 26, 2026 10:28
@TCMeldrum TCMeldrum requested review from ACLay and removed request for a team June 26, 2026 10:28
Comment on lines +476 to +479
addUsersRoles(userIds: number[], roleIds: number[]): Promise<boolean> {
throw new Error('Method not implemented.');
}
removeUsersRoles(userIds: number[], roleIds: number[]): Promise<boolean> {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mainly thinking for consistency's sake, would it be worth adding async to the method definitions here?

cy.contains('Assign Roles').click();
});

it.only('Officer can bulk assign roles to users', function () {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this meant to be it.only() instead of it()?

Comment on lines +13 to +16
//New query for user with roles
//Make sure offset is like max 10
// Only like 3 calls to uows or something
// Check performace

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feels like an in development TODO. If it was addressed, is it meant to be here still?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants