Class AccessDecisionManagerImpl

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware, org.springframework.security.access.AccessDecisionManager

    public class AccessDecisionManagerImpl
    extends org.springframework.security.access.vote.AbstractAccessDecisionManager
    This class polls its internal list of AccessDecisionVoters to come to an AuthZ decision for the principal (authentication) and resource.
    Author:
    Andrew Woods Date: Mar 12, 2010
    • Field Summary

      • Fields inherited from class org.springframework.security.access.vote.AbstractAccessDecisionManager

        logger, messages
    • Constructor Summary

      Constructors 
      Constructor Description
      AccessDecisionManagerImpl​(List<org.springframework.security.access.AccessDecisionVoter<? extends Object>> decisionVoters)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void decide​(org.springframework.security.core.Authentication authentication, Object resource, Collection<org.springframework.security.access.ConfigAttribute> config)
      This method implements to AccessDecisionManager interface.
      • Methods inherited from class org.springframework.security.access.vote.AbstractAccessDecisionManager

        afterPropertiesSet, checkAllowIfAllAbstainDecisions, getDecisionVoters, isAllowIfAllAbstainDecisions, setAllowIfAllAbstainDecisions, setMessageSource, supports, supports
    • Constructor Detail

      • AccessDecisionManagerImpl

        public AccessDecisionManagerImpl​(List<org.springframework.security.access.AccessDecisionVoter<? extends Object>> decisionVoters)
    • Method Detail

      • decide

        public void decide​(org.springframework.security.core.Authentication authentication,
                           Object resource,
                           Collection<org.springframework.security.access.ConfigAttribute> config)
                    throws org.springframework.security.access.AccessDeniedException
         This method implements to AccessDecisionManager interface.
         Each voter in the internal list of AccessDecisionVoters is presented with
         all of the configAttributes for the arg resource.
         - If all voters abstain from voting, the decision goes to the default
             setting: allowIfAllAbstainDecisions
         - If no voter denies the AuthZ vote and at least one voter grants, then
           AuthZ is granted.
         
        Parameters:
        authentication - principal seeking AuthZ
        resource - that is under protection
        config - access-attributes defined on resource
        Throws:
        org.springframework.security.access.AccessDeniedException - if AuthZ denied