@JsonProperty("hasModeratorRights") public boolean getHasModeratorRights() { if (SecurityUtils.isUserInRole(AuthoritiesConstants.ADMIN)) return true; for (User moderator : this.moderators) { if (moderator.getLogin().equals(SecurityUtils.getCurrentLogin())) return true; } return false; }
@JsonProperty("allowLike") public boolean getAllowLike() { return !this.deleted && !this.read && !this.likes.contains(SecurityUtils.getCurrentLogin()); }