com.vaadin.flow.spring.security.
Class VaadinRolePrefixHolder
All Implemented Interfaces:
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
ConstructorsConstructorDescriptionVaadinRolePrefixHolder
(String rolePrefix) Construct
VaadinRolePrefixHolder
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 given
DefaultSecurityFilterChain
.
-
Constructor Details
-
VaadinRolePrefixHolder
Construct
VaadinRolePrefixHolder
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 a
VaadinServletRequest
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 given
DefaultSecurityFilterChain
. 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.
-