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.
-
Field Summary
Fields inherited from interface org.springframework.security.access.AccessDecisionVoter
ACCESS_ABSTAIN, ACCESS_DENIED, ACCESS_GRANTED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the transition source prefix.Gets the transition target prefix.void
setTransitionSourcePrefix
(String transitionSourcePrefix) Allows the default transition source prefix ofTRANSITION_SOURCE_
to be overridden.void
setTransitionTargetPrefix
(String transitionTargetPrefix) Allows the default transition target prefix ofTRANSITION_TARGET_
to be overridden.boolean
boolean
supports
(org.springframework.security.access.ConfigAttribute attribute) int
vote
(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:
supports
in interfaceorg.springframework.security.access.AccessDecisionVoter<S>
-
supports
- Specified by:
supports
in 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:
vote
in 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
-