com.caucho.security
Class Allow

java.lang.Object
  extended by com.caucho.server.security.SecurityConstraint
      extended by com.caucho.security.Allow
Direct Known Subclasses:
Require

public class Allow
extends SecurityConstraint

The <sec:Allow> tag authorizes requests for a set of url-patterns. If the request URL matches, <sec:Allow> checks all its children ServletReqestPredicate for matches, and if all children match, the request is authorized.

If the url-patterns match but the children don't match, Resin checks following <sec:Allow> and <sec:Deny> tags to see if they match. If of the following tags match, Resin will reject the request. This chaining lets you solve more complicated authorization requirements simply.

 <web-app xmlns="http://caucho.com/ns/resin"
          xmlns:sec="urn:java:com.caucho.security">

   <sec:Allow url-pattern="*.jsp"/>

   <sec:Allow>
     <sec:url-pattern>/admin/*<sec:url-pattern>
     <sec:url-pattern>/security/*<sec:url-pattern>

     <sec:IfNetwork>192.168.0.1</sec:IfNetwork>
   </sec:Allow>

 </web-app>
 


Constructor Summary
Allow()
           
 
Method Summary
 void add(RequestPredicate predicate)
          Adds a match
 void addURLPattern(java.lang.String pattern)
          Sets the url-pattern
 AbstractConstraint getConstraint()
          return the constraint
 java.util.ArrayList<java.lang.String> getMethods(java.lang.String url)
          Returns the HTTP methods.
protected  java.util.ArrayList<RequestPredicate> getPredicateList()
           
 boolean isFallthrough()
          Returns true for a fallthrough.
 boolean isMatch(java.lang.String url)
          Returns true for the URL match
 
Methods inherited from class com.caucho.server.security.SecurityConstraint
add, addAuthConstraint, addConstraint, addIPConstraint, addRoleName, addWebResourceCollection, init, setDescription, setDisplayName, setFallthrough, setUserDataConstraint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Allow

public Allow()
Method Detail

getPredicateList

protected java.util.ArrayList<RequestPredicate> getPredicateList()

addURLPattern

public void addURLPattern(java.lang.String pattern)
Sets the url-pattern

Overrides:
addURLPattern in class SecurityConstraint

add

public void add(RequestPredicate predicate)
Adds a match


isMatch

public boolean isMatch(java.lang.String url)
Returns true for the URL match

Overrides:
isMatch in class SecurityConstraint

isFallthrough

public boolean isFallthrough()
Returns true for a fallthrough.

Overrides:
isFallthrough in class SecurityConstraint

getMethods

public java.util.ArrayList<java.lang.String> getMethods(java.lang.String url)
Returns the HTTP methods.

Overrides:
getMethods in class SecurityConstraint

getConstraint

public AbstractConstraint getConstraint()
return the constraint

Overrides:
getConstraint in class SecurityConstraint