01: /*
02: * regain - A file search engine providing plenty of formats
03: * Copyright (C) 2004 Til Schneider
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: *
19: * Contact: Til Schneider, info@murfman.de
20: *
21: * CVS information:
22: * $RCSfile$
23: * $Source$
24: * $Date: 2005-04-14 10:15:34 +0200 (Do, 14 Apr 2005) $
25: * $Author: til132 $
26: * $Revision: 130 $
27: */
28: package net.sf.regain.search.access;
29:
30: import java.util.Properties;
31:
32: import net.sf.regain.RegainException;
33: import net.sf.regain.util.sharedtag.PageRequest;
34:
35: /**
36: * Identifies the groups a user has reading rights for.
37: * <p>
38: * This interface is a part of the access control system that ensures that only
39: * those documents are shown in the search results that the user is allowed to
40: * read.
41: *
42: * @see net.sf.regain.crawler.access.CrawlerAccessController
43: * @author Tilman Schneider, STZ-IDA an der FH Karlsruhe
44: */
45: public interface SearchAccessController {
46:
47: /**
48: * Initializes the CrawlerAccessController.
49: * <p>
50: * This method is called once right after the CrawlerAccessController instance
51: * was created.
52: *
53: * @param config The configuration.
54: *
55: * @throws RegainException If loading the config failed.
56: */
57: public void init(Properties config) throws RegainException;
58:
59: /**
60: * Gets the groups the current user has reading rights for.
61: * <p>
62: * Note: The group array must not be <code>null</code> and the group names
63: * must not contain whitespace.
64: *
65: * @param request The page request to use for identifying the user.
66: * @return The groups of the current user.
67: *
68: * @throws RegainException If getting the groups failed.
69: */
70: public String[] getUserGroups(PageRequest request)
71: throws RegainException;
72:
73: }
|