KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nemesis > forum > proxy > UserIteratorProxy


1 /*
2  * NEMESIS-FORUM.
3  * Copyright (C) 2002 David Laurent(lithium2@free.fr). All rights reserved.
4  *
5  * Copyright (c) 2000 The Apache Software Foundation. All rights reserved.
6  *
7  * Copyright (C) 2001 Yasna.com. All rights reserved.
8  *
9  * Copyright (C) 2000 CoolServlets.com. All rights reserved.
10  *
11  * NEMESIS-FORUM. is free software; you can redistribute it and/or
12  * modify it under the terms of the Apache Software License, Version 1.1,
13  * or (at your option) any later version.
14  *
15  * NEMESIS-FORUM core framework, NEMESIS-FORUM backoffice, NEMESIS-FORUM frontoffice
16  * application are parts of NEMESIS-FORUM and are distributed under
17  * same terms of licence.
18  *
19  *
20  * NEMESIS-FORUM includes software developed by the Apache Software Foundation (http://www.apache.org/)
21  * and software developed by CoolServlets.com (http://www.coolservlets.com).
22  * and software developed by Yasna.com (http://www.yasna.com).
23  *
24  */

25
26
27 package org.nemesis.forum.proxy;
28
29 import java.util.Iterator JavaDoc;
30 import java.util.NoSuchElementException JavaDoc;
31
32 import org.nemesis.forum.Authorization;
33 import org.nemesis.forum.ForumPermissions;
34 import org.nemesis.forum.User;
35
36 /**
37  * Protection proxy for User iterators.
38  */

39 class UserIteratorProxy extends IteratorProxy {
40
41     public UserIteratorProxy(Iterator JavaDoc iterator, Authorization
42         authorization, ForumPermissions permissions)
43     {
44         super(iterator, authorization, permissions);
45     }
46
47     public Object JavaDoc next() throws NoSuchElementException JavaDoc {
48         User user = (User)iterator.next();
49         ForumPermissions userPermissions = user.getPermissions(authorization);
50         ForumPermissions newPermissions =
51                 new ForumPermissions(permissions, userPermissions);
52         return new UserProxy(user, authorization, newPermissions);
53     }
54 }
55
Popular Tags