Skip to content

Commit

Permalink
Reaction is always visible to its owner, even if a detailed list of a…
Browse files Browse the repository at this point in the history
…ll reactions is not visible.
  • Loading branch information
smelamud committed Jul 13, 2022
1 parent ca9d1d2 commit c1567db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public ReactionInfo get(@PathVariable UUID postingId, @PathVariable UUID comment
if (!comment.getPosting().getId().equals(postingId)) {
throw new ObjectNotFoundFailure("comment.wrong-posting");
}
if (!requestContext.isPrincipal(comment.getViewReactionsE())) {
if (!requestContext.isPrincipal(comment.getViewReactionsE()) && !requestContext.isClient(ownerName)) {
return ReactionInfo.ofComment(commentId); // FIXME ugly, return 404
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public ReactionInfo get(@PathVariable UUID postingId, @PathVariable String owner
if (!requestContext.isPrincipal(posting.getViewE())) {
throw new ObjectNotFoundFailure("posting.not-found");
}
if (!requestContext.isPrincipal(posting.getViewReactionsE())) {
if (!requestContext.isPrincipal(posting.getViewReactionsE()) && !requestContext.isClient(ownerName)) {
return ReactionInfo.ofPosting(postingId); // FIXME ugly, return 404
}

Expand Down

0 comments on commit c1567db

Please sign in to comment.