| java.lang.Object sunlabs.brazil.handler.AclSwitchHandler
AclSwitchHandler | public class AclSwitchHandler implements Handler(Code) | | Simple access control hander based on url prefixes or regexps.
Looks up list of valid prefixes or regular expressions in
sunlabs.brazil.server.Request.props , and allows/denies
access based on those prefixes.
This is expected to work in conjunction with an upstream handler,
such as
sunlabs.brazil.handler.RolesHandler or
sunlabs.brazil.handler.BasicAuthHandler that examines the request, and place credentials into the
request object. The credentials consist of url prefixes
or regular expressions that match classes of url's. Documents
whose URL prefix don't match a credential are rejected.
If a credential does not begin with a slash (/), the
AclSwitchHandler.init prefix
for this handler is prepended.
Properties:
- prefix
- The URL prefix that triggers this handler
- authName
- The name of the request.props entry to find a
white-space delimited list of url prefixes or
regular expression patterns. (defaults to "roles").
If the items in the list don't start with "/", then
the url prefix is prepended (only for prefix matching).
- redirect
- Name of the url to re-direct to if permission is denied.
If not specified, a simple message is sent to the client.
- useRegexp
- If provided, the list of credentials is interpreted as
regular expressions, otherwise url prefixes are used.
author: Stephen Uhler version: 1.10, 01/01/05 |
ACLNAME | final static String ACLNAME(Code) | | Handler configuration property authName.
The name of the request property to fine a white space
delimited list of credentials - URL prefixes - for this
request. Defaults to roles.
|
PREFIX | final static String PREFIX(Code) | | Handler configuration property prefix.
Only URL's that begin with this string are considered by this handler.
The default is (/).
|
REDIRECT | final static String REDIRECT(Code) | | Name of the url to re-direct to if permission is denied.
If not specified, a simple error message is sent to the client
|
useRegexp | boolean useRegexp(Code) | | |
|
|