示例#1
0
文件: Course.java 项目: tohalla/isla
 @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;
 }
示例#2
0
文件: Comment.java 项目: tohalla/isla
 @JsonProperty("allowLike")
 public boolean getAllowLike() {
   return !this.deleted && !this.read && !this.likes.contains(SecurityUtils.getCurrentLogin());
 }