From b642c55f053583533e23b1fc7fc5ac318fcbd7f0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 10 May 2018 15:04:57 +0300 Subject: using User::isAnonymous where possible --- juick-api/src/main/java/com/juick/server/api/Post.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'juick-api/src/main/java/com/juick') diff --git a/juick-api/src/main/java/com/juick/server/api/Post.java b/juick-api/src/main/java/com/juick/server/api/Post.java index d007b9af..afe9d2d5 100644 --- a/juick-api/src/main/java/com/juick/server/api/Post.java +++ b/juick-api/src/main/java/com/juick/server/api/Post.java @@ -157,7 +157,7 @@ public class Post { @ResponseStatus(value = HttpStatus.OK) public Status doPostRecomm(@RequestParam Integer mid) throws Exception { com.juick.User visitor = UserUtils.getCurrentUser(); - if (visitor.getUid() == 0) { + if (visitor.isAnonymous()) { throw new HttpForbiddenException(); } com.juick.Message msg = messagesService.getMessage(mid); @@ -185,7 +185,7 @@ public class Post { logger.info("got reaction with type: {}", reactionId); com.juick.User visitor = UserUtils.getCurrentUser(); - if (visitor.getUid() == 0) { + if (visitor.isAnonymous()) { throw new HttpForbiddenException(); } com.juick.Message msg = messagesService.getMessage(mid); -- cgit v1.2.3