com.caucho.rewrite
Class IfUserInRole

java.lang.Object
  extended by 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.


Constructor Summary
IfUserInRole()
           
 
Method Summary
 void addRole(java.lang.String role)
          Adds a role to check.
 boolean isMatch(HttpServletRequest request)
          True if the predicate matches.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IfUserInRole

public IfUserInRole()
Method Detail

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