01: /*
02: * JSPWiki - a JSP-based WikiWiki clone. Copyright (C) 2001-2003 Janne Jalkanen
03: * (Janne.Jalkanen@iki.fi) This program is free software; you can redistribute
04: * it and/or modify it under the terms of the GNU Lesser General Public License
05: * as published by the Free Software Foundation; either version 2.1 of the
06: * License, or (at your option) any later version. This program is distributed
07: * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
08: * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
09: * See the GNU Lesser General Public License for more details. You should have
10: * received a copy of the GNU Lesser General Public License along with this
11: * program; if not, write to the Free Software Foundation, Inc., 59 Temple
12: * Place, Suite 330, Boston, MA 02111-1307 USA
13: */
14: package com.ecyrd.jspwiki.auth.authorize;
15:
16: import java.security.Principal;
17:
18: import javax.servlet.http.HttpServletRequest;
19:
20: import com.ecyrd.jspwiki.auth.Authorizer;
21:
22: /**
23: * Extends the {@link com.ecyrd.jspwiki.auth.Authorizer} interface by
24: * including a delgate method for
25: * {@link javax.servlet.http.HttpServletRequest#isUserInRole(String)}.
26: * @author Andrew Jaquith
27: */
28: public interface WebAuthorizer extends Authorizer {
29:
30: /**
31: * Determines whether a user associated with an HTTP request possesses
32: * a particular role. This method simply delegates to
33: * {@link javax.servlet.http.HttpServletRequest#isUserInRole(String)}
34: * by converting the Principal's name to a String.
35: * @param request the HTTP request
36: * @param role the role to check
37: * @return <code>true</code> if the user is considered to be in the role,
38: * <code>false</code> otherwise
39: */
40: public boolean isUserInRole(HttpServletRequest request,
41: Principal role);
42:
43: }
|