Package com.skyline.base.exception

Examples of com.skyline.base.exception.NoVisitPermissionException


    // Date d1=new Date();
    ModelAndView mav = new ModelAndView();
    Article article = articleService.getArticleById(articleId);
    Integer authority = AuthorityUtil.getAuthority(null, article.getOwnerId());
    if (authority < article.getAuthority()) {
      throw new NoVisitPermissionException();
    } else {
      articleService.addVisitNum(articleId);
    }
    mav.addObject("ARTICLE", article);
    mav.addObject("AUTHORITY", authority);
View Full Code Here


    ModelAndView mav = new ModelAndView();
    Article article = articleService.getPriorArticle(categoryId, articleId, readAuthority);
    if (article != null) {
      Integer authority = AuthorityUtil.getAuthority(null, article.getOwnerId());
      if (authority < readAuthority || authority < article.getAuthority()) {
        throw new NoVisitPermissionException();
      } else {
        mav.addObject("AUTHORITY", authority);
        articleService.addVisitNum(articleId);
      }
    } else {
View Full Code Here

    ModelAndView mav = new ModelAndView();
    Article article = articleService.getNextArticle(categoryId, articleId, readAuthority);
    if (article != null) {
      Integer authority = AuthorityUtil.getAuthority(null, article.getOwnerId());
      if (authority < readAuthority || authority < article.getAuthority()) {
        throw new NoVisitPermissionException();
      } else {
        mav.addObject("AUTHORITY", authority);
        articleService.addVisitNum(articleId);
      }
    } else {
View Full Code Here

    Album album = albumService.getAlbumById(albumId);
    // 判断权限
    if (album != null) {
      int albumAuth = album.getAuthority();
      if (authority < albumAuth) {
        throw new NoVisitPermissionException("ID为:" + viewerId + "的用户没有访问ID为:"
            + album.getId() + "相册的权限");
      }
    } else {
      throw new NoVisitPermissionException("ID:" + viewerId + "没有访问相册的权限");
    }
    List<Photo> photos = albumService.listPhotosOfAlbum(albumId, viewerId, authority, page,
        addVisitCount);

    ModelAndView mav = new ModelAndView(ViewPaths.ALBUM_VIEWALBUM);
View Full Code Here

    Photo photo = albumService.getPhotoDetailById(photoId, viewerId, addVisitCount);
    // 判断权限
    if (photo != null) {
      int albumAuth = photo.getAuthority();
      if (authority < albumAuth) {
        throw new NoVisitPermissionException("ID为:" + viewerId + "的用户没有访问ID为:"
            + photo.getId() + "图片的权限");
      }
    } else {
      throw new NoResourceException("ID为:" + photoId + "的图片不存在");
    }
View Full Code Here

TOP

Related Classes of com.skyline.base.exception.NoVisitPermissionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.