1 53 54 106 107 package com.Yasna.forum; 108 109 import java.util.*; 110 111 118 class ForumIteratorProxy extends IteratorProxy { 119 120 private ArrayList forums = new ArrayList(); 121 122 public ForumIteratorProxy(Iterator iterator, Authorization 123 authorization, ForumPermissions permissions,boolean articles) 124 { 125 super(iterator, authorization, permissions); 128 129 while (iterator.hasNext()) { 130 Forum forum = (Forum)iterator.next(); 131 ForumPermissions forumPermissions = null; 132 if (!permissions.get(ForumPermissions.SYSTEM_ADMIN)) { 133 forumPermissions = forum.getPermissions(authorization); 134 } else { 135 forumPermissions = permissions; 136 } 137 if (permissions.get(ForumPermissions.SYSTEM_ADMIN) || forumPermissions.get(ForumPermissions.READ)){ 142 ForumProxy proxy = new ForumProxy(forum, authorization, forumPermissions); 143 if(!articles && forum.isArticleForum())continue; 144 forums.add(proxy); 145 } 146 } 147 148 this.iterator = forums.listIterator(); 149 } 150 151 public Object next() throws java.util.NoSuchElementException { 152 return iterator.next(); 153 } 154 } 155 | Popular Tags |