BUG reproduction (1) Create a root forum, Everyone reads (2) Create a Hidden Category, create a forum, name fororm (2) (3) Create a third category, create a Forum (3 Both are readable. Fill in the data in each forum, Rebuild Index. Go to Search.jsp Select Forum (3), fill in some words in the Forum (2), some words, search, query results, huh. Forum (2) in the result of returning. The correct result should be: here chooses forum (3), which is in the Forum (3), then it should be only allowed to return to Forum (3) results (both the earth know). Cause Analysis Looking at DBQuery.java :ExecuteQuery () code: // Forum Filter - We can Ignore Filtering If We Are Searching All
// forums in the system.
IF (forums.length! = 0 && factory.Getforumcount ()! = forums.length) {
String [] forumids = new string [forums.length];
For (int J = 0; j ForumIDS [J] = long.toString (forums [J] .GetId ()); } Multifilter.Add (New Fieldfilter ("ForumID", ForumIDS); Filtercount ; } The problem is in this SB IF () judgment! ! Here is a code publish query createQuery () {in ForumFactoryProxy.createQuery (). // Special Implementation of this Method So That We can determine // Actual List of forums That The User Has Permissions To Search over. ArrayList forumlist = new arraylist (); ITerator it = forums (); it.hasnext ();) { ForumList.Add (iter.next ()); } Forum [] forums = new forum [forumlist.size ()]; For (int i = 0; i Forums [i] = (forum) forumlist.get (i); } Return CREATEQUERY (forums); }