Package org.nemesis.forum.exception

Examples of org.nemesis.forum.exception.UnauthorizedException


      ProfileManager manager = forumFactory.getProfileManager();
      Group group = manager.getGroup( Integer.parseInt(request.getParameter("actor")));
       
      int perm=Integer.parseInt(request.getParameter("type"));
      if(perm==Constants.FORUM_ADMIN && ! SecurityTools.isSystemAdmin(getAuthToken(request))){
         throw new UnauthorizedException();
      }
      forum.removeGroupPermission(group, perm);
     
    } catch (NotFoundException e) {
      errors.add("general", new ActionError("forumPermission.forumNotFound"));
View Full Code Here


      ProfileManager manager = forumFactory.getProfileManager();
      Group group = manager.getGroup(request.getParameter("actor"));
       
      int perm=Integer.parseInt(request.getParameter("type"));
      if(perm==Constants.FORUM_ADMIN && ! SecurityTools.isSystemAdmin(getAuthToken(request))){
         throw new UnauthorizedException();
      }
      forum.addGroupPermission(group, perm);
     
    } catch (NotFoundException e) {
      errors.add("general", new ActionError("forumPermission.NotFound"));
View Full Code Here

  public Forum createForum(String name, String description) throws UnauthorizedException, ForumAlreadyExistsException {
    if (permissions.get(Constants.SYSTEM_ADMIN)) {
      Forum newForum = factory.createForum(name, description);
      return new ForumProxy(newForum, authorization, permissions);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void deleteForum(Forum forum) throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN)) {
      factory.deleteForum(forum);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

    //an UnauthorizedException.
    if (!(newPermissions.get(Constants.READ)
      || newPermissions.get(Constants.FORUM_ADMIN)
      || newPermissions.get(Constants.MODERATOR)
      || newPermissions.get(Constants.SYSTEM_ADMIN))) {
      throw new UnauthorizedException();
    }
    return new ForumProxy(forum, authorization, newPermissions);
  }
View Full Code Here

    //an UnauthorizedException.
    if (!(newPermissions.get(Constants.READ)
      || newPermissions.get(Constants.FORUM_ADMIN)
      || newPermissions.get(Constants.MODERATOR)
      || newPermissions.get(Constants.SYSTEM_ADMIN))) {
      throw new UnauthorizedException();
    }
    return new ForumProxy(forum, authorization, newPermissions);
  }
View Full Code Here

  public int[] usersWithPermission(int permissionType) throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN)) {
      return factory.usersWithPermission(permissionType);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public int[] groupsWithPermission(int permissionType) throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN)) {
      return factory.groupsWithPermission(permissionType);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

   */
  public ForumFactory getUnderlyingForumFactory() throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN)) {
      return factory;
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void setName(String name) throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN) || permissions.get(Constants.USER_ADMIN)) {
      user.setName(name);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

TOP

Related Classes of org.nemesis.forum.exception.UnauthorizedException

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.