Skip to content

Commit

Permalink
exclude deactivated users from role assignment autocomplete #2419 #4475
Browse files Browse the repository at this point in the history
Restore the query to what it was in previous releases.
Put the logic in the method.
  • Loading branch information
pdurbin committed Mar 17, 2021
1 parent 1e985b6 commit 0efee28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ public List<RoleAssignee> filterRoleAssignees(String query, DvObject dvObject, L
.getResultList().stream()
.filter(ra -> roleAssignSelectedRoleAssignees == null || !roleAssignSelectedRoleAssignees.contains(ra))
.forEach((ra) -> {
roleAssigneeList.add(ra);
if (!ra.isDeactivated()) {
roleAssigneeList.add(ra);
}
});

// now we add groups to the list, both global and explicit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
@NamedQuery( name="AuthenticatedUser.filter",
query="select au from AuthenticatedUser au WHERE ("
+ "LOWER(au.userIdentifier) like LOWER(:query) OR "
+ "lower(concat(au.firstName,' ',au.lastName)) like lower(:query)) "
+ "AND au.deactivated != true"),
+ "lower(concat(au.firstName,' ',au.lastName)) like lower(:query))"),
@NamedQuery( name="AuthenticatedUser.findAdminUser",
query="select au from AuthenticatedUser au WHERE "
+ "au.superuser = true "
Expand Down

0 comments on commit 0efee28

Please sign in to comment.