예제 #1
0
파일: User.java 프로젝트: enwida/idpRepo
 public List<Right> getAllRights() {
   final List<Right> result = new ArrayList<Right>();
   for (final Role role : getAllRoles()) {
     result.addAll(role.getRights());
   }
   return result;
 }
예제 #2
0
  @Transient
  @JsonIgnore
  public Collection<? extends GrantedAuthority> getAuthorities() {

    if (authorities.isEmpty()) {

      for (Role role : roles) {

        String[] rights = role.getRights().split(";");

        for (String right : rights) {

          if (NullEmptyChecker.isNotNullOrEmpty(right)) {
            authorities.add(new SimpleGrantedAuthority("ROLE_" + right));
          }
        }
      }
    }
    return authorities;
  }