aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-05-10 15:04:57 +0300
committerGravatar Vitaly Takmazov2018-05-10 15:04:57 +0300
commitb642c55f053583533e23b1fc7fc5ac318fcbd7f0 (patch)
tree3255d68fe48ee38aeba6de4359c631f9b9ddf70f /juick-api/src/main
parent78bc4cd5b9383320e989183942ba9ca11252a917 (diff)
using User::isAnonymous where possible
Diffstat (limited to 'juick-api/src/main')
-rw-r--r--juick-api/src/main/java/com/juick/server/api/Post.java4
1 files changed, 2 insertions, 2 deletions
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);