01: /*
02: * NEMESIS-FORUM.
03: * Copyright (C) 2002 David Laurent(lithium2@free.fr). All rights reserved.
04: *
05: * Copyright (c) 2000 The Apache Software Foundation. All rights reserved.
06: *
07: * Copyright (C) 2001 Yasna.com. All rights reserved.
08: *
09: * 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: package org.nemesis.forum.proxy;
27:
28: import java.util.Iterator;
29: import java.util.NoSuchElementException;
30:
31: import org.nemesis.forum.Authorization;
32: import org.nemesis.forum.ForumPermissions;
33: import org.nemesis.forum.User;
34:
35: /**
36: * Protection proxy for User iterators.
37: */
38: class UserIteratorProxy extends IteratorProxy {
39:
40: public UserIteratorProxy(Iterator iterator,
41: Authorization authorization, ForumPermissions permissions) {
42: super (iterator, authorization, permissions);
43: }
44:
45: public Object next() throws NoSuchElementException {
46: User user = (User) iterator.next();
47: ForumPermissions userPermissions = user
48: .getPermissions(authorization);
49: ForumPermissions newPermissions = new ForumPermissions(
50: permissions, userPermissions);
51: return new UserProxy(user, authorization, newPermissions);
52: }
53: }
|