예제 #1
0
 /**
  * 根据用户ID查找用户拥有的URL权限
  *
  * @param userId 用户ID
  * @return List<String> 用户拥有的markUrl地址
  */
 public List<String> getUserAuthoritysByUserId(Long userId)
     throws DaoException, SystemException, ServiceException {
   List<String> userAuthoritys = Lists.newArrayList();
   List<TreeNode> treeNodes = this.getResourceTreeByUserId(userId);
   for (TreeNode node : treeNodes) {
     Object obj = node.getAttributes().get("markUrl");
     if (obj != null) {
       String markUrl = (String) obj;
       if (StringUtils.isNotBlank(markUrl)) {
         userAuthoritys.add(markUrl);
       }
     }
     // 二级目录
     List<TreeNode> childrenNodes = node.getChildren();
     for (TreeNode childrenNode : childrenNodes) {
       Object childrenObj = childrenNode.getAttributes().get("markUrl");
       if (childrenObj != null) {
         String markUrl = (String) childrenObj;
         if (StringUtils.isNotBlank(markUrl)) {
           userAuthoritys.add(markUrl);
         }
       }
     }
   }
   return userAuthoritys;
 }