ForumFactory forumFactory = ForumFactory.getInstance(getAuthToken(request));
ProfileManager manager = forumFactory.getProfileManager();
User user = manager.getUser(getAuthToken(request).getUserID());
try {
ForumBean fb=(ForumBean)PropertyUtils.getProperty(form, "forumBean");
ForumFactory ff =ForumFactory.getInstance(getAuthToken(request));
Forum f =ff.createForum(fb.getName(),fb.getDescription());
//ForumPermissions permissions = forumFactory.getPermissions(getAuthToken(request));
//boolean isSystemAdmin = permissions.get(ForumPermissions.SYSTEM_ADMIN);
//boolean isUserAdmin = permissions.get(ForumPermissions.FORUM_ADMIN);
//f.addUserPermission(user,Constants.FORUM_ADMIN);
f.addUserPermission(user,Constants.READ);
f.addUserPermission(user,Constants.MODERATOR);
f.addUserPermission(user,Constants.CREATE_THREAD);
f.addUserPermission(user,Constants.CREATE_MESSAGE);
f.addUserPermission(user,Constants.FORUM_ADMIN);
//if(SecurityTools.isSystemAdmin(getAuthToken(request)))
//f.addUserPermission(user,Constants.SYSTEM_ADMIN);
f.setModerationType(fb.getModerationType());
//properties
String temp=null;
for(Iterator it=fb.getProperties().keySet().iterator();it.hasNext();){
temp=(String)it.next();
f.setProperty(temp,(String)fb.getProperties().get(temp));
}
}
catch( AlreadyExistsException aee ) {