public List<Right> getAllRights() { final List<Right> result = new ArrayList<Right>(); for (final Role role : getAllRoles()) { result.addAll(role.getRights()); } return result; }
@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; }