Class AbstractAccessDecisionManager
- java.lang.Object
-
- org.springframework.security.access.vote.AbstractAccessDecisionManager
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,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 ofAccessDecisionManager.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).
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractAccessDecisionManager(java.util.List<AccessDecisionVoter<?>> decisionVoters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected voidcheckAllowIfAllAbstainDecisions()java.util.List<AccessDecisionVoter<?>>getDecisionVoters()booleanisAllowIfAllAbstainDecisions()voidsetAllowIfAllAbstainDecisions(boolean allowIfAllAbstainDecisions)voidsetMessageSource(org.springframework.context.MessageSource messageSource)booleansupports(java.lang.Class<?> clazz)Iterates through allAccessDecisionVoters and ensures each can support the presented class.booleansupports(ConfigAttribute attribute)Indicates whether thisAccessDecisionManageris able to process authorization requests presented with the passedConfigAttribute.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.springframework.security.access.AccessDecisionManager
decide
-
-
-
-
Constructor Detail
-
AbstractAccessDecisionManager
protected AbstractAccessDecisionManager(java.util.List<AccessDecisionVoter<?>> decisionVoters)
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
checkAllowIfAllAbstainDecisions
protected final void checkAllowIfAllAbstainDecisions()
-
getDecisionVoters
public java.util.List<AccessDecisionVoter<?>> getDecisionVoters()
-
isAllowIfAllAbstainDecisions
public boolean isAllowIfAllAbstainDecisions()
-
setAllowIfAllAbstainDecisions
public void setAllowIfAllAbstainDecisions(boolean allowIfAllAbstainDecisions)
-
setMessageSource
public void setMessageSource(org.springframework.context.MessageSource messageSource)
- Specified by:
setMessageSourcein interfaceorg.springframework.context.MessageSourceAware
-
supports
public boolean supports(ConfigAttribute attribute)
Description copied from interface:AccessDecisionManagerIndicates whether thisAccessDecisionManageris able to process authorization requests presented with the passedConfigAttribute.This allows the
AbstractSecurityInterceptorto check every configuration attribute can be consumed by the configuredAccessDecisionManagerand/orRunAsManagerand/orAfterInvocationManager.- Specified by:
supportsin interfaceAccessDecisionManager- Parameters:
attribute- a configuration attribute that has been configured against theAbstractSecurityInterceptor- Returns:
- true if this
AccessDecisionManagercan support the passed configuration attribute
-
supports
public boolean supports(java.lang.Class<?> clazz)
Iterates through allAccessDecisionVoters and ensures each can support the presented class.If one or more voters cannot support the presented class,
falseis returned.- Specified by:
supportsin interfaceAccessDecisionManager- Parameters:
clazz- the type of secured object being presented- Returns:
- true if this type is supported
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-