diff --git a/server/impl/src/main/java/com/walmartlabs/concord/server/user/UserResourceV2.java b/server/impl/src/main/java/com/walmartlabs/concord/server/user/UserResourceV2.java index 6c4e1426ac..d0c27980ca 100644 --- a/server/impl/src/main/java/com/walmartlabs/concord/server/user/UserResourceV2.java +++ b/server/impl/src/main/java/com/walmartlabs/concord/server/user/UserResourceV2.java @@ -91,8 +91,8 @@ public UserEntry get(@PathParam("id") UUID id) { UUID authenticatedId = loggedIn.getId(); - if(!authenticatedId.equals(id)) { - assertAdmin(); + if(!authenticatedId.equals(id) && !Roles.isAdmin()) { + throw new UnauthorizedException("Users can only view their own information or must have admin privileges."); } return userDao.get(id);