Package com.vaadin.flow.spring.security
Class VaadinRolePrefixHolder
java.lang.Object
com.vaadin.flow.spring.security.VaadinRolePrefixHolder
- All Implemented Interfaces:
Serializable
Holds role prefix accessible outside an active request. Role prefix should
match with
SecurityContextHolderAwareRequestWrapper
in Spring
Security context aware environments to allow utilities like
AuthenticationUtil
to check roles in the same
way with same role prefix.- See Also:
-
Constructor Summary
ConstructorDescriptionVaadinRolePrefixHolder
(String rolePrefix) ConstructVaadinRolePrefixHolder
with a role prefix. -
Method Summary
Modifier and TypeMethodDescriptionReturn role prefix.boolean
isSet()
Gets boolean flag indicating if role prefix is set or not.void
resetRolePrefix
(VaadinRequest request) Reset role prefix from the given request.void
resetRolePrefix
(org.springframework.security.web.DefaultSecurityFilterChain defaultSecurityFilterChain) Reset role prefix from the givenDefaultSecurityFilterChain
.
-
Constructor Details
-
VaadinRolePrefixHolder
ConstructVaadinRolePrefixHolder
with a role prefix.- Parameters:
rolePrefix
- Role prefix.
-
-
Method Details
-
getRolePrefix
Return role prefix. May be null.- Returns:
- Role prefix
-
isSet
public boolean isSet()Gets boolean flag indicating if role prefix is set or not.- Returns:
- true when role prefix is set, false otherwise.
-
resetRolePrefix
Reset role prefix from the given request. Works only with aVaadinServletRequest
and a chain ofServletRequestWrapper
s to findSecurityContextHolderAwareRequestWrapper
with the role prefix. Method doesn't do anything if role prefix is not found.- Parameters:
request
- Vaadin request used to find active role prefix.
-
resetRolePrefix
public void resetRolePrefix(org.springframework.security.web.DefaultSecurityFilterChain defaultSecurityFilterChain) Reset role prefix from the givenDefaultSecurityFilterChain
. Method doesn't do anything if role prefix is not found.- Parameters:
defaultSecurityFilterChain
- Default security filter chain used to find active role prefix.- Throws:
NullPointerException
- IfdefaultSecurityFilterChain
is null.
-