Esempio n. 1
0
 @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;
 }
Esempio n. 2
0
 @JsonProperty("allowLike")
 public boolean getAllowLike() {
   return !this.deleted && !this.read && !this.likes.contains(SecurityUtils.getCurrentLogin());
 }