org.springframework.security.web.access
Class DefaultWebInvocationPrivilegeEvaluator

java.lang.Object
  extended by org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator
All Implemented Interfaces:
WebInvocationPrivilegeEvaluator

public class DefaultWebInvocationPrivilegeEvaluator
extends Object
implements WebInvocationPrivilegeEvaluator

Allows users to determine whether they have privileges for a given web URI.

Since:
3.0
Version:
$Id: DefaultWebInvocationPrivilegeEvaluator.java 4060 2009-12-13 17:37:24Z ltaylor $
Author:
Ben Alex, Luke Taylor

Field Summary
protected static org.apache.commons.logging.Log logger
           
 
Constructor Summary
DefaultWebInvocationPrivilegeEvaluator(AbstractSecurityInterceptor securityInterceptor)
           
 
Method Summary
 boolean isAllowed(String uri, Authentication authentication)
          Determines whether the user represented by the supplied Authentication object is allowed to invoke the supplied URI.
 boolean isAllowed(String contextPath, String uri, String method, Authentication authentication)
          Determines whether the user represented by the supplied Authentication object is allowed to invoke the supplied URI, with the given .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.commons.logging.Log logger
Constructor Detail

DefaultWebInvocationPrivilegeEvaluator

public DefaultWebInvocationPrivilegeEvaluator(AbstractSecurityInterceptor securityInterceptor)
Method Detail

isAllowed

public boolean isAllowed(String uri,
                         Authentication authentication)
Determines whether the user represented by the supplied Authentication object is allowed to invoke the supplied URI.

Specified by:
isAllowed in interface WebInvocationPrivilegeEvaluator
Parameters:
uri - the URI excluding the context path (a default context path setting will be used)

isAllowed

public boolean isAllowed(String contextPath,
                         String uri,
                         String method,
                         Authentication authentication)
Determines whether the user represented by the supplied Authentication object is allowed to invoke the supplied URI, with the given .

Note the default implementation of FilterInvocationSecurityMetadataSource disregards the contextPath when evaluating which secure object metadata applies to a given request URI, so generally the contextPath is unimportant unless you are using a custom FilterInvocationSecurityMetadataSource.

Specified by:
isAllowed in interface WebInvocationPrivilegeEvaluator
Parameters:
uri - the URI excluding the context path
contextPath - the context path (may be null, in which case a default value will be used).
method - the HTTP method (or null, for any method)
authentication - the Authentication instance whose authorities should be used in evaluation whether access should be granted.
Returns:
true if access is allowed, false if denied


Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.