com.caucho.rewrite
Class IfUserInRole
java.lang.Object
com.caucho.rewrite.IfUserInRole
- All Implemented Interfaces:
- RequestPredicate
@Configurable
public class IfUserInRole
- extends java.lang.Object
- implements RequestPredicate
Match if the user is in any of the given roles,
i.e. if request.isUserInRole() matches.
<resin:Allow url-pattern="/admin/*">
xmlns:resin="urn:java:com.caucho.resin">
<resin:IfUserInRole role="admin"/>
</resin:Allow>
RequestPredicates may be used for security and rewrite actions.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
IfUserInRole
public IfUserInRole()
addRole
@Configurable
public void addRole(java.lang.String role)
- Adds a role to check. The user must match one of the roles.
isMatch
public boolean isMatch(HttpServletRequest request)
- True if the predicate matches.
- Specified by:
isMatch
in interface RequestPredicate
- Parameters:
request
- the servlet request to test
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object