public class

PreInvocationAuthorizationAdviceVoter

extends Object
implements AccessDecisionVoter<S>
java.lang.Object
   ↳ org.springframework.security.access.prepost.PreInvocationAuthorizationAdviceVoter

Class Overview

Voter which performs the actions using a PreInvocationAuthorizationAdvice implementation generated from @PreFilter and @PreAuthorize annotations.

In practice, if these annotations are being used, they will normally contain all the necessary access control logic, so a voter-based system is not really necessary and a single AccessDecisionManager which contained the same logic would suffice. However, this class fits in readily with the traditional voter-based AccessDecisionManager implementations used by Spring Security.

Summary

[Expand]
Inherited Constants
From interface org.springframework.security.access.AccessDecisionVoter
Fields
protected final Log logger
Public Constructors
PreInvocationAuthorizationAdviceVoter(PreInvocationAuthorizationAdvice pre)
Public Methods
boolean supports(Class<?> clazz)
Indicates whether the AccessDecisionVoter implementation is able to provide access control votes for the indicated secured object type.
boolean supports(ConfigAttribute attribute)
Indicates whether this AccessDecisionVoter is able to vote on the passed ConfigAttribute.
int vote(Authentication authentication, MethodInvocation method, Collection<ConfigAttribute> attributes)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.security.access.AccessDecisionVoter

Fields

protected final Log logger

Public Constructors

public PreInvocationAuthorizationAdviceVoter (PreInvocationAuthorizationAdvice pre)

Public Methods

public boolean supports (Class<?> clazz)

Indicates whether the AccessDecisionVoter implementation is able to provide access control votes for the indicated secured object type.

Parameters
clazz the class that is being queried
Returns
  • true if the implementation can process the indicated class

public boolean supports (ConfigAttribute attribute)

Indicates whether this AccessDecisionVoter is able to vote on 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.

Parameters
attribute a configuration attribute that has been configured against the AbstractSecurityInterceptor
Returns
  • true if this AccessDecisionVoter can support the passed configuration attribute

public int vote (Authentication authentication, MethodInvocation method, Collection<ConfigAttribute> attributes)