Class TransitionVoter<S,E>
java.lang.Object
org.springframework.statemachine.security.TransitionVoter<S,E>
- Type Parameters:
S- the type of stateE- the type of event
- All Implemented Interfaces:
org.springframework.security.access.AccessDecisionVoter<Transition<S,E>>
public class TransitionVoter<S,E>
extends Object
implements org.springframework.security.access.AccessDecisionVoter<Transition<S,E>>
Votes if any
ConfigAttribute.getAttribute() starts with a prefix indicating
that it is a transition source or target. The default prefixes strings are
TRANSITION_SOURCE and TRANSITION_TARGET, but
those may be overridden to any value. It may also be set to empty, which means that
essentially any attribute will be voted on. As described further below, the effect
of an empty prefix may not be quite desirable.
All comparisons and prefixes are case sensitive.
- Author:
- Janne Valkealahti
-
Field Summary
Fields inherited from interface org.springframework.security.access.AccessDecisionVoter
ACCESS_ABSTAIN, ACCESS_DENIED, ACCESS_GRANTED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the transition source prefix.Gets the transition target prefix.voidsetTransitionSourcePrefix(String transitionSourcePrefix) Allows the default transition source prefix ofTRANSITION_SOURCE_to be overridden.voidsetTransitionTargetPrefix(String transitionTargetPrefix) Allows the default transition target prefix ofTRANSITION_TARGET_to be overridden.booleanbooleansupports(org.springframework.security.access.ConfigAttribute attribute) intvote(org.springframework.security.core.Authentication authentication, Transition<S, E> transition, Collection<org.springframework.security.access.ConfigAttribute> attributes)
-
Constructor Details
-
TransitionVoter
public TransitionVoter()
-
-
Method Details
-
supports
public boolean supports(org.springframework.security.access.ConfigAttribute attribute) - Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<S>
-
supports
- Specified by:
supportsin interfaceorg.springframework.security.access.AccessDecisionVoter<S>
-
vote
public int vote(org.springframework.security.core.Authentication authentication, Transition<S, E> transition, Collection<org.springframework.security.access.ConfigAttribute> attributes) - Specified by:
votein interfaceorg.springframework.security.access.AccessDecisionVoter<S>
-
getTransitionSourcePrefix
Gets the transition source prefix.- Returns:
- the transition source prefix
-
setTransitionSourcePrefix
Allows the default transition source prefix ofTRANSITION_SOURCE_to be overridden. May be set to an empty value, although this is usually not desirable.- Parameters:
transitionSourcePrefix- the new transition source prefix
-
getTransitionTargetPrefix
Gets the transition target prefix.- Returns:
- the transition target prefix
-
setTransitionTargetPrefix
Allows the default transition target prefix ofTRANSITION_TARGET_to be overridden. May be set to an empty value, although this is usually not desirable.- Parameters:
transitionTargetPrefix- the new transition source prefix
-