From ee3227180a02557d4f5c667f2b852138702c9b37 Mon Sep 17 00:00:00 2001 From: Julian Kniephoff Date: Tue, 23 Apr 2024 08:37:43 +0200 Subject: [PATCH] Fix deleting user references from the admin UI Fixes #5753, where a `matterhoron-reference` user could not be deleted, presumably because it wasn't found. This was broken by #5062, and looks like a classic merge conflict resolution mistake to me. The result is that we look up the user we want to delete in the user and roles provider twice, and ignore the user reference provider, which happens to be `null` anyway, since it is never bound in the first place. --- .../adminui/endpoint/UsersEndpoint.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/modules/admin-ui/src/main/java/org/opencastproject/adminui/endpoint/UsersEndpoint.java b/modules/admin-ui/src/main/java/org/opencastproject/adminui/endpoint/UsersEndpoint.java index ee46062a473..9fc4b0a2b9c 100644 --- a/modules/admin-ui/src/main/java/org/opencastproject/adminui/endpoint/UsersEndpoint.java +++ b/modules/admin-ui/src/main/java/org/opencastproject/adminui/endpoint/UsersEndpoint.java @@ -162,6 +162,15 @@ public void setSecurityService(SecurityService securityService) { this.securityService = securityService; } + /** + * @param jpaUserReferenceProvider + * the user provider to set + */ + @Reference + public void setJpaUserReferenceProvider(JpaUserReferenceProvider jpaUserReferenceProvider) { + this.jpaUserReferenceProvider = jpaUserReferenceProvider; + } + /** * @param jpaUserAndRoleProvider * the user provider to set @@ -439,7 +448,7 @@ public Response deleteUser(@PathParam("username") String username) throws NotFou try { try { - jpaUserAndRoleProvider.deleteUser(username, organization.getId()); + jpaUserReferenceProvider.deleteUser(username, organization.getId()); } catch (NotFoundException e) { userReferenceNotFound = true; }