Package org.nemesis.forum.exception

Examples of org.nemesis.forum.exception.UnauthorizedException


  public void removeUserPermission(User user, int permissionType) throws UnauthorizedException {
    if (permissions.isSystemOrForumAdmin()) {
      forum.removeUserPermission(user, permissionType);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here


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

  public void addGroupPermission(Group group, int permissionType) throws UnauthorizedException {
    //Don't let someone become a System Admin through this method.
    //The ForumPermissions class probably needs to be changed.
    if (permissionType == Constants.SYSTEM_ADMIN) {
      throw new UnauthorizedException();
    }
    if (permissions.isSystemOrForumAdmin()) {
      forum.addGroupPermission(group, permissionType);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void removeGroupPermission(Group group, int permissionType) throws UnauthorizedException {
    if (permissions.isSystemOrForumAdmin()) {
      forum.removeGroupPermission(group, permissionType);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

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

  public MessageFilter[] getForumMessageFilters() throws UnauthorizedException {
    if (permissions.isSystemOrForumAdmin()) {
      return forum.getForumMessageFilters();
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void addForumMessageFilter(MessageFilter filter) throws UnauthorizedException {
    if (permissions.isSystemOrForumAdmin()) {
      forum.addForumMessageFilter(filter);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void addForumMessageFilter(MessageFilter filter, int index) throws UnauthorizedException {
    if (permissions.isSystemOrForumAdmin()) {
      forum.addForumMessageFilter(filter, index);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void removeForumMessageFilter(int index) throws UnauthorizedException {
    if (permissions.isSystemOrForumAdmin()) {
      forum.removeForumMessageFilter(index);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

      User user = manager.getUser( 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.removeUserPermission(user, perm);
     
    } catch (NotFoundException e) {
      errors.add("general", new ActionError("forumPermission.forumNotFound"));
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.