Package org.nemesis.forum.exception

Examples of org.nemesis.forum.exception.UnauthorizedException


  }

  public static void flush(Authorization auth) throws UnauthorizedException{
    ForumFactory forumFactory = ForumFactory.getInstance(auth);
    if(! forumFactory.getPermissions(auth).get(Constants.SYSTEM_ADMIN)) throw new UnauthorizedException();
    try {
      IndexWriter writer = new IndexWriter(new File(PATH), new StopAnalyzer(), true);
      writer.close();
    } catch (IOException e) {
      log.error("impossible de flusher l'index ", e);
View Full Code Here


    }
  }
 
  public static void reindex(Authorization auth) throws UnauthorizedException{
    ForumFactory forumFactory = ForumFactory.getInstance(auth);
    if(! forumFactory.getPermissions(auth).get(Constants.SYSTEM_ADMIN)) throw new UnauthorizedException();
    //ok system admin
    flush(auth);
    Forum f=null;
    ForumThread ft=null;
    for(Iterator it=forumFactory.forums();it.hasNext();){
View Full Code Here

  /**
   * @param b
   */
  public static void setAutoIndex(boolean b,Authorization auth) throws UnauthorizedException {
    ForumFactory forumFactory = ForumFactory.getInstance(auth);
    if(! forumFactory.getPermissions(auth).get(Constants.SYSTEM_ADMIN)) throw new UnauthorizedException();
    autoIndex = b;
  }
View Full Code Here

    throws UnauthorizedException, GroupAlreadyExistsException {
    if (permissions.get(Constants.SYSTEM_ADMIN)) {
      Group group = profileManager.createGroup(name);
      return new GroupProxy(group, authorization, permissions);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void deleteUser(User user) throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN)) {
      profileManager.deleteUser(user);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void deleteGroup(Group group) throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN)) {
      profileManager.deleteGroup(group);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

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

  public void setDescription(String description) throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN) || permissions.get(Constants.GROUP_ADMIN)) {
      group.setDescription(description);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void addAdministrator(User user) throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN) || permissions.get(Constants.GROUP_ADMIN)) {
      group.addAdministrator(user);
    } else {
      throw new UnauthorizedException();
    }
  }
View Full Code Here

  public void removeAdministrator(User user) throws UnauthorizedException {
    if (permissions.get(Constants.SYSTEM_ADMIN) || permissions.get(Constants.GROUP_ADMIN)) {
      group.removeAdministrator(user);
    } 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.