org.springframework.security.access.vote
Class AbstractAccessDecisionManager

java.lang.Object
  extended by org.springframework.security.access.vote.AbstractAccessDecisionManager
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware, AccessDecisionManager
Direct Known Subclasses:
AffirmativeBased, ConsensusBased, UnanimousBased

public abstract class AbstractAccessDecisionManager
extends java.lang.Object
implements AccessDecisionManager, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware

Abstract implementation of AccessDecisionManager.

Handles configuration of a bean context defined list of AccessDecisionVoters and the access control behaviour if all voters abstain from voting (defaults to deny access).


Field Summary
protected  org.apache.commons.logging.Log logger
           
protected  org.springframework.context.support.MessageSourceAccessor messages
           
 
Constructor Summary
AbstractAccessDecisionManager()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  void checkAllowIfAllAbstainDecisions()
           
 java.util.List<AccessDecisionVoter> getDecisionVoters()
           
 boolean isAllowIfAllAbstainDecisions()
           
 void setAllowIfAllAbstainDecisions(boolean allowIfAllAbstainDecisions)
           
 void setDecisionVoters(java.util.List<AccessDecisionVoter> newList)
           
 void setMessageSource(org.springframework.context.MessageSource messageSource)
           
 boolean supports(java.lang.Class<?> clazz)
          Iterates through all AccessDecisionVoters and ensures each can support the presented class.
 boolean supports(ConfigAttribute attribute)
          Indicates whether this AccessDecisionManager is able to process authorization requests presented with the passed ConfigAttribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.security.access.AccessDecisionManager
decide
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger

messages

protected org.springframework.context.support.MessageSourceAccessor messages
Constructor Detail

AbstractAccessDecisionManager

public AbstractAccessDecisionManager()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

checkAllowIfAllAbstainDecisions

protected final void checkAllowIfAllAbstainDecisions()

getDecisionVoters

public java.util.List<AccessDecisionVoter> getDecisionVoters()

isAllowIfAllAbstainDecisions

public boolean isAllowIfAllAbstainDecisions()

setAllowIfAllAbstainDecisions

public void setAllowIfAllAbstainDecisions(boolean allowIfAllAbstainDecisions)

setDecisionVoters

public void setDecisionVoters(java.util.List<AccessDecisionVoter> newList)

setMessageSource

public void setMessageSource(org.springframework.context.MessageSource messageSource)
Specified by:
setMessageSource in interface org.springframework.context.MessageSourceAware

supports

public boolean supports(ConfigAttribute attribute)
Description copied from interface: AccessDecisionManager
Indicates whether this AccessDecisionManager is able to process authorization requests presented with the passed ConfigAttribute.

This allows the AbstractSecurityInterceptor to check every configuration attribute can be consumed by the configured AccessDecisionManager and/or RunAsManager and/or AfterInvocationManager.

Specified by:
supports in interface AccessDecisionManager
Parameters:
attribute - a configuration attribute that has been configured against the AbstractSecurityInterceptor
Returns:
true if this AccessDecisionManager can support the passed configuration attribute

supports

public boolean supports(java.lang.Class<?> clazz)
Iterates through all AccessDecisionVoters and ensures each can support the presented class.

If one or more voters cannot support the presented class, false is returned.

Specified by:
supports in interface AccessDecisionManager
Parameters:
clazz - the type of secured object being presented
Returns:
true if this type is supported