/** * 获取授予用户组的权利 * * @return */ public List<String> getAuthorities() { List<String> result = new ArrayList<>(); for (Role role : roles) { result.addAll(role.getAuthorities()); } return result; }
@Transient public Collection<String> getRoleList() { Collection<String> roles = new ArrayList<>(); if (role != null) { for (Authority authority : role.getAuthorities()) { roles.add(authority.getName()); } } return roles; }