コード例 #1
0
ファイル: UserGroup.java プロジェクト: JiaoMing/APDPlat
 /**
  * 获取授予用户组的权利
  *
  * @return
  */
 public List<String> getAuthorities() {
   List<String> result = new ArrayList<>();
   for (Role role : roles) {
     result.addAll(role.getAuthorities());
   }
   return result;
 }
コード例 #2
0
ファイル: User.java プロジェクト: pploye/CRM
  @Transient
  public Collection<String> getRoleList() {
    Collection<String> roles = new ArrayList<>();

    if (role != null) {
      for (Authority authority : role.getAuthorities()) {
        roles.add(authority.getName());
      }
    }

    return roles;
  }