Skip to content

Commit

Permalink
feat: invalidate user session when user's role memberships changes
Browse files Browse the repository at this point in the history
  • Loading branch information
netroms committed Nov 13, 2023
1 parent 1d5293e commit 53337ef
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ void updateRolesAuthoritiesShouldInvalidateUserSessions() {

UserRole roleB = createUserRole("ROLE_B", "ALL");
userService.addUserRole(roleB);
superUser.getUserRoles().add(roleB);
userService.updateUser(superUser);

PATCH(
"/users/" + superUser.getUid(),
"[{'op':'add','path':'/userRoles','value':[{'id':'" + roleB.getUid() + "'}]}]")
.content(HttpStatus.OK);

String roleBID = userService.getUserRoleByName("ROLE_B").getUid();

Expand Down

0 comments on commit 53337ef

Please sign in to comment.