Skip to content

Commit

Permalink
Allow clients to upload group avatar at creation time
Browse files Browse the repository at this point in the history
  • Loading branch information
eager-signal committed Dec 18, 2024
1 parent e486655 commit 64bce59
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,10 @@ public CompletableFuture<Response> getAvatarUploadForm(@Auth GroupUser user) {

return groupsManager.getGroup(user.getGroupId()).thenApply(group -> {

if (group.isEmpty()) {
return Response.status(Response.Status.NOT_FOUND).build();
}

if (!GroupAuth.isModifyAttributesAllowed(user, group.get())) {
return Response.status(Response.Status.FORBIDDEN).build();
if (group.isPresent()) {
if (!GroupAuth.isModifyAttributesAllowed(user, group.get())) {
return Response.status(Response.Status.FORBIDDEN).build();
}
}

final byte[] object = new byte[16];
Expand Down

0 comments on commit 64bce59

Please sign in to comment.